diff options
author | Rebecca Turner <me@re-becca.org> | 2018-04-13 00:11:31 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2018-04-13 00:11:32 +0300 |
commit | 4781b64bcc47d4e7fb7025fd6517cde044f6b5e1 (patch) | |
tree | a7ea4f6c032b0c3e2f4be242f397f1b9e49b6560 /node_modules | |
parent | 0b802f2a0bfa15c6af8074ebf9347f07bccdbcc7 (diff) |
libnpmhook@4.0.1
Credit: @zkat
Diffstat (limited to 'node_modules')
120 files changed, 11762 insertions, 3125 deletions
diff --git a/node_modules/libnpmhook/CHANGELOG.md b/node_modules/libnpmhook/CHANGELOG.md index 1c2a361d7..6fe3e05b5 100644 --- a/node_modules/libnpmhook/CHANGELOG.md +++ b/node_modules/libnpmhook/CHANGELOG.md @@ -2,6 +2,31 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +<a name="4.0.1"></a> +## [4.0.1](https://github.com/npm/libnpmhook/compare/v4.0.0...v4.0.1) (2018-04-09) + + + +<a name="4.0.0"></a> +# [4.0.0](https://github.com/npm/libnpmhook/compare/v3.0.1...v4.0.0) (2018-04-08) + + +### meta + +* drop support for node 4 and 7 ([f2a301e](https://github.com/npm/libnpmhook/commit/f2a301e)) + + +### BREAKING CHANGES + +* node@4 and node@7 are no longer supported + + + +<a name="3.0.1"></a> +## [3.0.1](https://github.com/npm/libnpmhook/compare/v3.0.0...v3.0.1) (2018-04-08) + + + <a name="3.0.0"></a> # [3.0.0](https://github.com/npm/libnpmhook/compare/v2.0.1...v3.0.0) (2018-04-04) diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/CHANGELOG.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/CHANGELOG.md index 05d5741ee..8f9366551 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/CHANGELOG.md +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/CHANGELOG.md @@ -2,6 +2,67 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +<a name="3.1.1"></a> +## [3.1.1](https://github.com/npm/registry-fetch/compare/v3.1.0...v3.1.1) (2018-04-09) + + + +<a name="3.1.0"></a> +# [3.1.0](https://github.com/npm/registry-fetch/compare/v3.0.0...v3.1.0) (2018-04-09) + + +### Features + +* **config:** support no-proxy and https-proxy options ([9aa906b](https://github.com/npm/registry-fetch/commit/9aa906b)) + + + +<a name="3.0.0"></a> +# [3.0.0](https://github.com/npm/registry-fetch/compare/v2.1.0...v3.0.0) (2018-04-09) + + +### Bug Fixes + +* **api:** pacote integration-related fixes ([a29de4f](https://github.com/npm/registry-fetch/commit/a29de4f)) +* **config:** stop caring about opts.config ([5856a6f](https://github.com/npm/registry-fetch/commit/5856a6f)) + + +### BREAKING CHANGES + +* **config:** opts.config is no longer supported. Pass the options down in opts itself. + + + +<a name="2.1.0"></a> +# [2.1.0](https://github.com/npm/registry-fetch/compare/v2.0.0...v2.1.0) (2018-04-08) + + +### Features + +* **token:** accept opts.token for opts._authToken ([108c9f0](https://github.com/npm/registry-fetch/commit/108c9f0)) + + + +<a name="2.0.0"></a> +# [2.0.0](https://github.com/npm/registry-fetch/compare/v1.1.1...v2.0.0) (2018-04-08) + + +### meta + +* drop support for node@4 ([758536e](https://github.com/npm/registry-fetch/commit/758536e)) + + +### BREAKING CHANGES + +* node@4 is no longer supported + + + +<a name="1.1.1"></a> +## [1.1.1](https://github.com/npm/registry-fetch/compare/v1.1.0...v1.1.1) (2018-04-06) + + + <a name="1.1.0"></a> # [1.1.0](https://github.com/npm/registry-fetch/compare/v1.0.1...v1.1.0) (2018-03-16) diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/README.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/README.md index 4947dc891..3d55eef6d 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/README.md +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/README.md @@ -88,21 +88,6 @@ Fetch options are optional, and can be passed in as either a Map-like object (one with a `.get()` method), a plain javascript object, or a [`figgy-pudding`](https://npm.im/figgy-pudding) instance. -##### <a name="opts-auth-token"></a> `opts._authToken` - -* Type: String -* Default: null - -Authentication token string. - -Can be scoped to a registry by using a "nerf dart" for that registry. That is: - -``` -{ - '//registry.npmjs.org/:_authToken': 't0k3nH34r' -} -``` - ##### <a name="opts-agent"></a> `opts.agent` * Type: http.Agent @@ -362,7 +347,7 @@ account. * Default: null Password used for basic authentication. For the more modern authentication -method, please use the (more secure) [`opts._authToken`](#opts-auth-token) +method, please use the (more secure) [`opts.token`](#opts-token) Can optionally be scoped to a registry by using a "nerf dart" for that registry. That is: @@ -513,6 +498,22 @@ See also [`opts.ca`](#opts-ca). Time before a hanging request times out. +##### <a name="opts-token"></a> `opts.token` + +* Alias: `opts._authToken` +* Type: String +* Default: null + +Authentication token string. + +Can be scoped to a registry by using a "nerf dart" for that registry. That is: + +``` +{ + '//registry.npmjs.org/:token': 't0k3nH34r' +} +``` + ##### <a name="opts-user-agent"></a> `opts.user-agent` * Type: String @@ -526,7 +527,7 @@ User agent string to send in the `User-Agent` header. * Default: null Username used for basic authentication. For the more modern authentication -method, please use the (more secure) [`opts._authToken`](#opts-auth-token) +method, please use the (more secure) [`opts.token`](#opts-token) Can optionally be scoped to a registry by using a "nerf dart" for that registry. That is: @@ -545,4 +546,4 @@ See also [`opts.password`](#opts-password) * Default: null ** DEPRECATED ** This is a legacy authentication token supported only for -*compatibility. Please us [`opts._authToken`](#opts-auth-token) instead. +*compatibility. Please use [`opts.token`](#opts-token) instead. diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/auth.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/auth.js index f4f7316db..9532341db 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/auth.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/auth.js @@ -10,6 +10,7 @@ function getAuth (registry, opts) { let AUTH = {} const regKey = registry && registryKey(registry) const doKey = (key, alias) => addKey(opts, AUTH, regKey, key, alias) + doKey('token') doKey('_authToken', 'token') doKey('username') doKey('password') diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/config.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/config.js index 6249f66e0..db08c1e47 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/config.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/config.js @@ -1,12 +1,12 @@ 'use strict' const pkg = require('./package.json') -const pudding = require('figgy-pudding') +const figgyPudding = require('figgy-pudding') const silentLog = require('./silentlog.js') -const AUTH_REGEX = /^(?:.*:)?(_authToken|username|_password|password|email|always-auth|_auth|otp)$/ +const AUTH_REGEX = /^(?:.*:)?(token|_authToken|username|_password|password|email|always-auth|_auth|otp)$/ const SCOPE_REGISTRY_REGEX = /@.*:registry$/gi -const RegFetchConfig = pudding({ +module.exports = figgyPudding({ 'agent': {}, 'algorithms': {}, 'body': {}, @@ -19,6 +19,7 @@ const RegFetchConfig = pudding({ 'fetch-retry-mintimeout': {}, 'gid': {}, 'headers': {}, + 'https-proxy': {}, 'integrity': {}, 'is-from-ci': 'isFromCI', 'isFromCI': { @@ -45,6 +46,7 @@ const RegFetchConfig = pudding({ 'method': { default: 'GET' }, + 'no-proxy': {}, 'noproxy': {}, 'npm-session': 'npmSession', 'npmSession': {}, @@ -86,9 +88,3 @@ const RegFetchConfig = pudding({ return key.match(AUTH_REGEX) || key.match(SCOPE_REGISTRY_REGEX) } }) - -module.exports = config -function config (opts) { - opts = opts || {} - return RegFetchConfig(opts, opts.config) -} diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/index.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/index.js index cf6e8d3bf..bb6ddeaee 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/index.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/index.js @@ -8,14 +8,11 @@ const getAuth = require('./auth.js') const fetch = require('make-fetch-happen') const npa = require('npm-package-arg') const qs = require('querystring') -const silentLog = require('./silentlog.js') const url = require('url') module.exports = regFetch function regFetch (uri, opts) { - opts = config(Object.assign({ - log: silentLog - }, opts)) + opts = config(opts) const registry = ( (opts.get('spec') && pickRegistry(opts.get('spec'), opts)) || opts.get('registry') || @@ -69,9 +66,9 @@ function regFetch (uri, opts) { maxSockets: opts.get('maxsockets'), memoize: opts.get('memoize'), method: opts.get('method') || 'GET', - noProxy: opts.get('noproxy'), + noProxy: opts.get('no-proxy') || opts.get('noproxy'), Promise: opts.get('Promise'), - proxy: opts.get('proxy'), + proxy: opts.get('https-proxy') || opts.get('proxy'), referer: opts.get('refer'), retry: opts.get('retry') || { retries: opts.get('fetch-retries'), @@ -97,9 +94,6 @@ module.exports.pickRegistry = pickRegistry function pickRegistry (spec, opts) { spec = npa(spec) opts = config(opts) - if (!spec.registry) { - throw new Error(`${spec} is not a valid registry dependency spec`) - } let registry = spec.scope && opts.get(spec.scope.replace(/^@?/, '@') + ':registry') diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/CHANGELOG.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/CHANGELOG.md index 123133fe6..b83beda41 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/CHANGELOG.md +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/CHANGELOG.md @@ -2,6 +2,31 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +<a name="4.0.1"></a> +## [4.0.1](https://github.com/zkat/make-fetch-happen/compare/v4.0.0...v4.0.1) (2018-04-12) + + +### Bug Fixes + +* **integrity:** use new sri.match() for verification ([4f371a0](https://github.com/zkat/make-fetch-happen/commit/4f371a0)) + + + +<a name="4.0.0"></a> +# [4.0.0](https://github.com/zkat/make-fetch-happen/compare/v3.0.0...v4.0.0) (2018-04-09) + + +### meta + +* drop node@4, add node@9 ([7b0191a](https://github.com/zkat/make-fetch-happen/commit/7b0191a)) + + +### BREAKING CHANGES + +* node@4 is no longer supported + + + <a name="3.0.0"></a> # [3.0.0](https://github.com/zkat/make-fetch-happen/compare/v2.6.0...v3.0.0) (2018-03-12) diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/cache.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/cache.js index edb9b3d03..0c519e69f 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/cache.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/cache.js @@ -234,15 +234,7 @@ function matchDetails (req, cached) { } } if (cached.integrity) { - const cachedSri = ssri.parse(cached.cacheIntegrity) - const sri = ssri.parse(cached.integrity) - const algo = sri.pickAlgorithm() - if (cachedSri[algo] && !sri[algo].some(hash => { - // cachedSri always has exactly one item per algorithm - return cachedSri[algo][0].digest === hash.digest - })) { - return false - } + return ssri.parse(cached.integrity).match(cached.cacheIntegrity) } reqUrl.hash = null cacheUrl.hash = null diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/.npmignore b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/.npmignore deleted file mode 100644 index 5cd2673c9..000000000 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -*~ -*sublime-* -generation -test -wiki -coverage diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/.travis.yml b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/.travis.yml index 636d8d912..3eab7fdb3 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/.travis.yml +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/.travis.yml @@ -20,3 +20,4 @@ packages: - gcc-4.8 - g++-4.8 + diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/Changelog.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/Changelog.md index 5102d7ce9..fa86821e3 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/Changelog.md +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/Changelog.md @@ -1,4 +1,16 @@ +# 0.4.21 / 2018-04-06 + + * Fix encoding canonicalization (#156) + * Fix the paths in the "browser" field in package.json (#174 by @LMLB) + * Removed "contributors" section in package.json - see Git history instead. + + +# 0.4.20 / 2018-04-06 + + * Updated `new Buffer()` usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR) + + # 0.4.19 / 2017-09-09 * Fixed iso8859-1 codec regression in handling untranslatable characters (#162, caused by #147) @@ -66,7 +78,7 @@ # 0.4.9 / 2015-05-24 - * Streamlined BOM handling: strip BOM by default, add BOM when encoding if + * Streamlined BOM handling: strip BOM by default, add BOM when encoding if addBOM: true. Added docs to Readme. * UTF16 now uses UTF16-LE by default. * Fixed minor issue with big5 encoding. @@ -77,7 +89,7 @@ # 0.4.8 / 2015-04-14 - + * added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94) @@ -85,12 +97,12 @@ * stop official support of Node.js v0.8. Should still work, but no guarantees. reason: Packages needed for testing are hard to get on Travis CI. - * work in environment where Object.prototype is monkey patched with enumerable + * work in environment where Object.prototype is monkey patched with enumerable props (#89). # 0.4.6 / 2015-01-12 - + * fix rare aliases of single-byte encodings (thanks @mscdex) * double the timeout for dbcs tests to make them less flaky on travis @@ -130,3 +142,5 @@ * browserify compatibility added * (optional) extend core primitive encodings to make usage even simpler * moved from vows to mocha as the testing framework + + diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/LICENSE b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/LICENSE index e3c1f8d36..d518d8376 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/LICENSE +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/LICENSE @@ -18,3 +18,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/README.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/README.md index 8c0bb9a48..c981c3708 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/README.md +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/README.md @@ -1,7 +1,7 @@ ## Pure JS character encoding conversion [![Build Status](https://travis-ci.org/ashtuchkin/iconv-lite.svg?branch=master)](https://travis-ci.org/ashtuchkin/iconv-lite) * Doesn't need native code compilation. Works on Windows and in sandboxed environments like [Cloud9](http://c9.io). - * Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), + * Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. * Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). * Intuitive encode/decode API @@ -20,7 +20,7 @@ var iconv = require('iconv-lite'); // Convert from an encoded buffer to js string. -str = iconv.decode(new Buffer([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251'); +str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251'); // Convert from js string to an encoded buffer. buf = iconv.encode("Sample input string", 'win1251'); @@ -83,7 +83,7 @@ fs.createReadStream("file.txt", "shift_jis"); // External modules are also supported (if they use Node primitives, which they probably do). request = require('request'); request({ - url: "http://github.com/", + url: "http://github.com/", encoding: "cp932" }); @@ -95,8 +95,8 @@ iconv.undoExtendNodeEncodings(); * All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex. * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap. - * All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, - IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. + * All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, + IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. Aliases like 'latin1', 'us-ascii' also supported. * All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP. @@ -109,7 +109,7 @@ Multibyte encodings are generated from [Unicode.org mappings](http://www.unicode ## Encoding/decoding speed -Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). +Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). Note: your results may vary, so please always check on your hardware. operation iconv@2.1.4 iconv-lite@0.4.7 @@ -129,15 +129,15 @@ Note: your results may vary, so please always check on your hardware. This library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be smart about endianness in the following ways: - * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be + * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`. * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override. ## Other notes -When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding). -Untranslatable characters are set to � or ?. No transliteration is currently supported. -Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77). +When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding). +Untranslatable characters are set to � or ?. No transliteration is currently supported. +Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77). ## Testing @@ -146,7 +146,7 @@ $ git clone git@github.com:ashtuchkin/iconv-lite.git $ cd iconv-lite $ npm install $ npm test - + $ # To view performance: $ node test/performance.js @@ -154,7 +154,3 @@ $ # To view test coverage: $ npm run coverage $ open coverage/lcov-report/index.html ``` - -## Adoption -[![NPM](https://nodei.co/npm-dl/iconv-lite.png)](https://nodei.co/npm/iconv-lite/) -[![Codeship Status for ashtuchkin/iconv-lite](https://www.codeship.com/projects/81670840-fa72-0131-4520-4a01a6c01acc/status)](https://www.codeship.com/projects/29053) diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-codec.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-codec.js index f6072c2a6..1fe3e1601 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-codec.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-codec.js @@ -1,5 +1,5 @@ "use strict"; -var Buffer = require("buffer").Buffer; +var Buffer = require("safer-buffer").Buffer; // Multibyte codec. In this scheme, a character is represented by 1 or more bytes. // Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. @@ -42,7 +42,7 @@ function DBCSCodec(codecOptions, iconv) { this.decodeTables = []; this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. - // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. + // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. this.decodeTableSeq = []; // Actual mapping tables consist of chunks. Use them to fill up decode tables. @@ -51,7 +51,7 @@ function DBCSCodec(codecOptions, iconv) { this.defaultCharUnicode = iconv.defaultCharUnicode; - + // Encode tables: Unicode -> DBCS. // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. @@ -60,7 +60,7 @@ function DBCSCodec(codecOptions, iconv) { // == UNASSIGNED -> no conversion found. Output a default char. // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. this.encodeTable = []; - + // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key // means end of sequence (needed when one sequence is a strict subsequence of another). @@ -78,7 +78,7 @@ function DBCSCodec(codecOptions, iconv) { for (var j = val.from; j <= val.to; j++) skipEncodeChars[j] = true; } - + // Use decode trie to recursively fill out encode tables. this._fillEncodeTable(0, 0, skipEncodeChars); @@ -115,7 +115,7 @@ function DBCSCodec(codecOptions, iconv) { thirdByteNode[i] = NODE_START - fourthByteNodeIdx; for (var i = 0x30; i <= 0x39; i++) fourthByteNode[i] = GB18030_CODE - } + } } DBCSCodec.prototype.encoder = DBCSEncoder; @@ -180,7 +180,7 @@ DBCSCodec.prototype._addDecodeChunk = function(chunk) { else writeTable[curAddr++] = code; // Basic char } - } + } else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. var charCode = writeTable[curAddr - 1] + 1; for (var l = 0; l < part; l++) @@ -211,7 +211,7 @@ DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { } DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { - + // Get the root of character tree according to first character of the sequence. var uCode = seq[0]; var bucket = this._getEncodeBucket(uCode); @@ -272,7 +272,7 @@ function DBCSEncoder(options, codec) { // Encoder state this.leadSurrogate = -1; this.seqObj = undefined; - + // Static data this.encodeTable = codec.encodeTable; this.encodeTableSeq = codec.encodeTableSeq; @@ -281,7 +281,7 @@ function DBCSEncoder(options, codec) { } DBCSEncoder.prototype.write = function(str) { - var newBuf = new Buffer(str.length * (this.gb18030 ? 4 : 3)), + var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i = 0, j = 0; @@ -294,7 +294,7 @@ DBCSEncoder.prototype.write = function(str) { } else { var uCode = nextChar; - nextChar = -1; + nextChar = -1; } // 1. Handle surrogates. @@ -316,7 +316,7 @@ DBCSEncoder.prototype.write = function(str) { // Incomplete surrogate pair - only trail surrogate found. uCode = UNASSIGNED; } - + } } else if (leadSurrogate !== -1) { @@ -357,7 +357,7 @@ DBCSEncoder.prototype.write = function(str) { var subtable = this.encodeTable[uCode >> 8]; if (subtable !== undefined) dbcsCode = subtable[uCode & 0xFF]; - + if (dbcsCode <= SEQ_START) { // Sequence start seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; continue; @@ -380,7 +380,7 @@ DBCSEncoder.prototype.write = function(str) { // 3. Write dbcsCode character. if (dbcsCode === UNASSIGNED) dbcsCode = this.defaultCharSingleByte; - + if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode; } @@ -404,7 +404,7 @@ DBCSEncoder.prototype.end = function() { if (this.leadSurrogate === -1 && this.seqObj === undefined) return; // All clean. Most often case. - var newBuf = new Buffer(10), j = 0; + var newBuf = Buffer.alloc(10), j = 0; if (this.seqObj) { // We're in the sequence. var dbcsCode = this.seqObj[DEF_CHAR]; @@ -427,7 +427,7 @@ DBCSEncoder.prototype.end = function() { newBuf[j++] = this.defaultCharSingleByte; this.leadSurrogate = -1; } - + return newBuf.slice(0, j); } @@ -440,7 +440,7 @@ DBCSEncoder.prototype.findIdx = findIdx; function DBCSDecoder(options, codec) { // Decoder state this.nodeIdx = 0; - this.prevBuf = new Buffer(0); + this.prevBuf = Buffer.alloc(0); // Static data this.decodeTables = codec.decodeTables; @@ -450,22 +450,22 @@ function DBCSDecoder(options, codec) { } DBCSDecoder.prototype.write = function(buf) { - var newBuf = new Buffer(buf.length*2), - nodeIdx = this.nodeIdx, + var newBuf = Buffer.alloc(buf.length*2), + nodeIdx = this.nodeIdx, prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length, seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence. uCode; if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later. prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]); - + for (var i = 0, j = 0; i < buf.length; i++) { var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset]; // Lookup in current trie node. var uCode = this.decodeTables[nodeIdx][curByte]; - if (uCode >= 0) { + if (uCode >= 0) { // Normal character, just use it. } else if (uCode === UNASSIGNED) { // Unknown char. @@ -497,7 +497,7 @@ DBCSDecoder.prototype.write = function(buf) { throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); // Write the character to buffer, handling higher planes using surrogate pair. - if (uCode > 0xFFFF) { + if (uCode > 0xFFFF) { uCode -= 0x10000; var uCodeLead = 0xD800 + Math.floor(uCode / 0x400); newBuf[j++] = uCodeLead & 0xFF; @@ -527,7 +527,7 @@ DBCSDecoder.prototype.end = function() { var buf = this.prevBuf.slice(1); // Parse remaining as usual. - this.prevBuf = new Buffer(0); + this.prevBuf = Buffer.alloc(0); this.nodeIdx = 0; if (buf.length > 0) ret += this.write(buf); @@ -552,3 +552,4 @@ function findIdx(table, val) { } return l; } + diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-data.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-data.js index 53cb75bd1..4b6191434 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-data.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-data.js @@ -5,11 +5,11 @@ // require()-s are direct to support Browserify. module.exports = { - + // == Japanese/ShiftJIS ==================================================== // All japanese encodings are based on JIS X set of standards: // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. - // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. + // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. // Has several variations in 1978, 1983, 1990 and 1997. // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. @@ -27,7 +27,7 @@ module.exports = { // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. // Used as-is in ISO2022 family. - // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, + // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, // 0201-1976 Roman, 0208-1978, 0208-1983. // * ISO2022-JP-1: Adds esc seq for 0212-1990. // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. @@ -139,7 +139,7 @@ module.exports = { // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ // * Big5-2003 (Taiwan standard) almost superset of cp950. // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. - // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. + // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. // Plus, it has 4 combining sequences. // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 @@ -150,7 +150,7 @@ module.exports = { // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt - // + // // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/index.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/index.js index 55144bd22..e30400317 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/index.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/index.js @@ -13,7 +13,7 @@ var modules = [ require("./dbcs-data"), ]; -// Put all encoding/alias/codec definitions to single object and export it. +// Put all encoding/alias/codec definitions to single object and export it. for (var i = 0; i < modules.length; i++) { var module = modules[i]; for (var enc in module) diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/internal.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/internal.js index 30e2c4756..05ce38b27 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/internal.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/internal.js @@ -1,5 +1,5 @@ "use strict"; -var Buffer = require("buffer").Buffer; +var Buffer = require("safer-buffer").Buffer; // Export Node.js internal encodings. @@ -33,7 +33,7 @@ function InternalCodec(codecOptions, iconv) { this.encoder = InternalEncoderCesu8; // Add decoder for versions of Node not supporting CESU-8 - if (new Buffer('eda0bdedb2a9', 'hex').toString() !== '💩') { + if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { this.decoder = InternalDecoderCesu8; this.defaultCharUnicode = iconv.defaultCharUnicode; } @@ -67,7 +67,7 @@ function InternalEncoder(options, codec) { } InternalEncoder.prototype.write = function(str) { - return new Buffer(str, this.enc); + return Buffer.from(str, this.enc); } InternalEncoder.prototype.end = function() { @@ -87,11 +87,11 @@ InternalEncoderBase64.prototype.write = function(str) { this.prevStr = str.slice(completeQuads); str = str.slice(0, completeQuads); - return new Buffer(str, "base64"); + return Buffer.from(str, "base64"); } InternalEncoderBase64.prototype.end = function() { - return new Buffer(this.prevStr, "base64"); + return Buffer.from(this.prevStr, "base64"); } @@ -102,7 +102,7 @@ function InternalEncoderCesu8(options, codec) { } InternalEncoderCesu8.prototype.write = function(str) { - var buf = new Buffer(str.length * 3), bufIdx = 0; + var buf = Buffer.alloc(str.length * 3), bufIdx = 0; for (var i = 0; i < str.length; i++) { var charCode = str.charCodeAt(i); // Naive implementation, but it works because CESU-8 is especially easy @@ -136,7 +136,7 @@ function InternalDecoderCesu8(options, codec) { } InternalDecoderCesu8.prototype.write = function(buf) { - var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, + var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, res = ''; for (var i = 0; i < buf.length; i++) { var curByte = buf[i]; diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-codec.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-codec.js index 2f818e171..f2258237b 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-codec.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-codec.js @@ -1,18 +1,18 @@ "use strict"; -var Buffer = require("buffer").Buffer; +var Buffer = require("safer-buffer").Buffer; // Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that -// correspond to encoded bytes (if 128 - then lower half is ASCII). +// correspond to encoded bytes (if 128 - then lower half is ASCII). exports._sbcs = SBCSCodec; function SBCSCodec(codecOptions, iconv) { if (!codecOptions) throw new Error("SBCS codec is called without the data.") - + // Prepare char buffer for decoding. if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); - + if (codecOptions.chars.length === 128) { var asciiString = ""; for (var i = 0; i < 128; i++) @@ -20,11 +20,10 @@ function SBCSCodec(codecOptions, iconv) { codecOptions.chars = asciiString + codecOptions.chars; } - this.decodeBuf = new Buffer(codecOptions.chars, 'ucs2'); - + this.decodeBuf = new Buffer.from(codecOptions.chars, 'ucs2'); + // Encoding buffer. - var encodeBuf = new Buffer(65536); - encodeBuf.fill(iconv.defaultCharSingleByte.charCodeAt(0)); + var encodeBuf = new Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); for (var i = 0; i < codecOptions.chars.length; i++) encodeBuf[codecOptions.chars.charCodeAt(i)] = i; @@ -41,10 +40,10 @@ function SBCSEncoder(options, codec) { } SBCSEncoder.prototype.write = function(str) { - var buf = new Buffer(str.length); + var buf = Buffer.alloc(str.length); for (var i = 0; i < str.length; i++) buf[i] = this.encodeBuf[str.charCodeAt(i)]; - + return buf; } @@ -59,7 +58,7 @@ function SBCSDecoder(options, codec) { SBCSDecoder.prototype.write = function(buf) { // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. var decodeBuf = this.decodeBuf; - var newBuf = new Buffer(buf.length*2); + var newBuf = Buffer.alloc(buf.length*2); var idx1 = 0, idx2 = 0; for (var i = 0; i < buf.length; i++) { idx1 = buf[i]*2; idx2 = i*2; diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data.js index 1009ad990..2d6f846ad 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data.js @@ -166,3 +166,4 @@ module.exports = { "mac": "macintosh", "csmacintosh": "macintosh", }; + diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/utf16.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/utf16.js index aa6cc716f..54765aeee 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/utf16.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/utf16.js @@ -1,5 +1,5 @@ "use strict"; -var Buffer = require("buffer").Buffer; +var Buffer = require("safer-buffer").Buffer; // Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js @@ -20,7 +20,7 @@ function Utf16BEEncoder() { } Utf16BEEncoder.prototype.write = function(str) { - var buf = new Buffer(str, 'ucs2'); + var buf = Buffer.from(str, 'ucs2'); for (var i = 0; i < buf.length; i += 2) { var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; } @@ -41,7 +41,7 @@ Utf16BEDecoder.prototype.write = function(buf) { if (buf.length == 0) return ''; - var buf2 = new Buffer(buf.length + 1), + var buf2 = Buffer.alloc(buf.length + 1), i = 0, j = 0; if (this.overflowByte !== -1) { @@ -115,7 +115,7 @@ Utf16Decoder.prototype.write = function(buf) { // Codec is not chosen yet. Accumulate initial bytes. this.initialBytes.push(buf); this.initialBytesLen += buf.length; - + if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below) return ''; @@ -173,3 +173,5 @@ function detectEncoding(buf, defaultEncoding) { return enc; } + + diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/utf7.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/utf7.js index 331457b1f..b7631c23a 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/utf7.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/encodings/utf7.js @@ -1,5 +1,5 @@ "use strict"; -var Buffer = require("buffer").Buffer; +var Buffer = require("safer-buffer").Buffer; // UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 // See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 @@ -26,9 +26,9 @@ function Utf7Encoder(options, codec) { Utf7Encoder.prototype.write = function(str) { // Naive implementation. // Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-". - return new Buffer(str.replace(nonDirectChars, function(chunk) { - return "+" + (chunk === '+' ? '' : - this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + return Buffer.from(str.replace(nonDirectChars, function(chunk) { + return "+" + (chunk === '+' ? '' : + this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + "-"; }.bind(this))); } @@ -50,7 +50,7 @@ var base64Chars = []; for (var i = 0; i < 256; i++) base64Chars[i] = base64Regex.test(String.fromCharCode(i)); -var plusChar = '+'.charCodeAt(0), +var plusChar = '+'.charCodeAt(0), minusChar = '-'.charCodeAt(0), andChar = '&'.charCodeAt(0); @@ -75,7 +75,7 @@ Utf7Decoder.prototype.write = function(buf) { res += "+"; } else { var b64str = base64Accum + buf.slice(lastI, i).toString(); - res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be"); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } if (buf[i] != minusChar) // Minus is absorbed after base64. @@ -97,7 +97,7 @@ Utf7Decoder.prototype.write = function(buf) { base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded); - res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be"); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } this.inBase64 = inBase64; @@ -109,7 +109,7 @@ Utf7Decoder.prototype.write = function(buf) { Utf7Decoder.prototype.end = function() { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) - res = this.iconv.decode(new Buffer(this.base64Accum, 'base64'), "utf16-be"); + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); this.inBase64 = false; this.base64Accum = ''; @@ -144,7 +144,7 @@ Utf7IMAPCodec.prototype.bomAware = true; function Utf7IMAPEncoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; - this.base64Accum = new Buffer(6); + this.base64Accum = Buffer.alloc(6); this.base64AccumIdx = 0; } @@ -152,7 +152,7 @@ Utf7IMAPEncoder.prototype.write = function(str) { var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, - buf = new Buffer(str.length*5 + 10), bufIdx = 0; + buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; for (var i = 0; i < str.length; i++) { var uChar = str.charCodeAt(i); @@ -198,7 +198,7 @@ Utf7IMAPEncoder.prototype.write = function(str) { } Utf7IMAPEncoder.prototype.end = function() { - var buf = new Buffer(10), bufIdx = 0; + var buf = Buffer.alloc(10), bufIdx = 0; if (this.inBase64) { if (this.base64AccumIdx > 0) { bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); @@ -246,7 +246,7 @@ Utf7IMAPDecoder.prototype.write = function(buf) { res += "&"; } else { var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/'); - res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be"); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } if (buf[i] != minusChar) // Minus may be absorbed after base64. @@ -268,7 +268,7 @@ Utf7IMAPDecoder.prototype.write = function(buf) { base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded); - res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be"); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } this.inBase64 = inBase64; @@ -280,9 +280,11 @@ Utf7IMAPDecoder.prototype.write = function(buf) { Utf7IMAPDecoder.prototype.end = function() { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) - res = this.iconv.decode(new Buffer(this.base64Accum, 'base64'), "utf16-be"); + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); this.inBase64 = false; this.base64Accum = ''; return res; } + + diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/bom-handling.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/bom-handling.js index b2b1e426d..105087238 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/bom-handling.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/bom-handling.js @@ -49,3 +49,4 @@ StripBOMWrapper.prototype.write = function(buf) { StripBOMWrapper.prototype.end = function() { return this.decoder.end(); } + diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/extend-node.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/extend-node.js index 40d1aa571..f4aaf9379 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/extend-node.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/extend-node.js @@ -1,5 +1,6 @@ "use strict"; var Buffer = require("buffer").Buffer; +// Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer // == Extend Node primitives to use iconv-lite ================================= @@ -8,6 +9,7 @@ module.exports = function (iconv) { // Node authors rewrote Buffer internals to make it compatible with // Uint8Array and we cannot patch key functions since then. + // Note: this does use older Buffer API on a purpose iconv.supportsNodeEncodingsExtension = !(new Buffer(0) instanceof Uint8Array); iconv.extendNodeEncodings = function extendNodeEncodings() { @@ -21,7 +23,7 @@ module.exports = function (iconv) { } var nodeNativeEncodings = { - 'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true, + 'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true, 'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true, }; diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/index.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/index.js index 990b421b3..5391919ca 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/index.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/index.js @@ -2,7 +2,7 @@ // Some environments don't have global Buffer (e.g. React Native). // Solution would be installing npm modules "buffer" and "stream" explicitly. -var Buffer = require("buffer").Buffer; +var Buffer = require("safer-buffer").Buffer; var bomHandling = require("./bom-handling"), iconv = module.exports; @@ -23,7 +23,7 @@ iconv.encode = function encode(str, encoding, options) { var res = encoder.write(str); var trail = encoder.end(); - + return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; } @@ -34,7 +34,7 @@ iconv.decode = function decode(buf, encoding, options) { iconv.skipDecodeWarning = true; } - buf = new Buffer("" + (buf || ""), "binary"); // Ensure buffer. + buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. } var decoder = iconv.getDecoder(encoding, options); @@ -63,9 +63,9 @@ iconv._codecDataCache = {}; iconv.getCodec = function getCodec(encoding) { if (!iconv.encodings) iconv.encodings = require("../encodings"); // Lazy load all encoding definitions. - + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. - var enc = (''+encoding).toLowerCase().replace(/[^0-9a-z]|:\d{4}$/g, ""); + var enc = iconv._canonicalizeEncoding(encoding); // Traverse iconv.encodings to find actual codec. var codecOptions = {}; @@ -87,7 +87,7 @@ iconv.getCodec = function getCodec(encoding) { if (!codecOptions.encodingName) codecOptions.encodingName = enc; - + enc = codecDef.type; break; @@ -108,6 +108,11 @@ iconv.getCodec = function getCodec(encoding) { } } +iconv._canonicalizeEncoding = function(encoding) { + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); +} + iconv.getEncoder = function getEncoder(encoding, options) { var codec = iconv.getCodec(encoding), encoder = new codec.encoder(options, codec); diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/streams.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/streams.js index bb4dbdaf4..440955295 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/streams.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/lib/streams.js @@ -6,7 +6,7 @@ var Buffer = require("buffer").Buffer, // == Exports ================================================================== module.exports = function(iconv) { - + // Additional Public API. iconv.encodeStream = function encodeStream(encoding, options) { return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); @@ -101,7 +101,7 @@ IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { IconvLiteDecoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); - if (res && res.length) this.push(res, this.encoding); + if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { @@ -118,3 +118,4 @@ IconvLiteDecoderStream.prototype.collect = function(cb) { }); return this; } + diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/LICENSE b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/LICENSE new file mode 100644 index 000000000..4fe9e6f10 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Nikita Skovoroda <chalkerx@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/Porting-Buffer.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/Porting-Buffer.md new file mode 100644 index 000000000..68d86bab0 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/Porting-Buffer.md @@ -0,0 +1,268 @@ +# Porting to the Buffer.from/Buffer.alloc API + +<a id="overview"></a> +## Overview + +- [Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x.](#variant-1) (*recommended*) +- [Variant 2: Use a polyfill](#variant-2) +- [Variant 3: manual detection, with safeguards](#variant-3) + +### Finding problematic bits of code using grep + +Just run `grep -nrE '[^a-zA-Z](Slow)?Buffer\s*\(' --exclude-dir node_modules`. + +It will find all the potentially unsafe places in your own code (with some considerably unlikely +exceptions). + +### Finding problematic bits of code using Node.js 8 + +If you’re using Node.js ≥ 8.0.0 (which is recommended), Node.js exposes multiple options that help with finding the relevant pieces of code: + +- `--trace-warnings` will make Node.js show a stack trace for this warning and other warnings that are printed by Node.js. +- `--trace-deprecation` does the same thing, but only for deprecation warnings. +- `--pending-deprecation` will show more types of deprecation warnings. In particular, it will show the `Buffer()` deprecation warning, even on Node.js 8. + +You can set these flags using an environment variable: + +```console +$ export NODE_OPTIONS='--trace-warnings --pending-deprecation' +$ cat example.js +'use strict'; +const foo = new Buffer('foo'); +$ node example.js +(node:7147) [DEP0005] DeprecationWarning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead. + at showFlaggedDeprecation (buffer.js:127:13) + at new Buffer (buffer.js:148:3) + at Object.<anonymous> (/path/to/example.js:2:13) + [... more stack trace lines ...] +``` + +### Finding problematic bits of code using linters + +Eslint rules [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +also find calls to deprecated `Buffer()` API. Those rules are included in some pre-sets. + +There is a drawback, though, that it doesn't always +[work correctly](https://github.com/chalker/safer-buffer#why-not-safe-buffer) when `Buffer` is +overriden e.g. with a polyfill, so recommended is a combination of this and some other method +described above. + +<a id="variant-1"></a> +## Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x. + +This is the recommended solution nowadays that would imply only minimal overhead. + +The Node.js 5.x release line has been unsupported since July 2016, and the Node.js 4.x release line reaches its End of Life in April 2018 (→ [Schedule](https://github.com/nodejs/Release#release-schedule)). This means that these versions of Node.js will *not* receive any updates, even in case of security issues, so using these release lines should be avoided, if at all possible. + +What you would do in this case is to convert all `new Buffer()` or `Buffer()` calls to use `Buffer.alloc()` or `Buffer.from()`, in the following way: + +- For `new Buffer(number)`, replace it with `Buffer.alloc(number)`. +- For `new Buffer(string)` (or `new Buffer(string, encoding)`), replace it with `Buffer.from(string)` (or `Buffer.from(string, encoding)`). +- For all other combinations of arguments (these are much rarer), also replace `new Buffer(...arguments)` with `Buffer.from(...arguments)`. + +Note that `Buffer.alloc()` is also _faster_ on the current Node.js versions than +`new Buffer(size).fill(0)`, which is what you would otherwise need to ensure zero-filling. + +Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +is recommended to avoid accidential unsafe Buffer API usage. + +There is also a [JSCodeshift codemod](https://github.com/joyeecheung/node-dep-codemod#dep005) +for automatically migrating Buffer constructors to `Buffer.alloc()` or `Buffer.from()`. +Note that it currently only works with cases where the arguments are literals or where the +constructor is invoked with two arguments. + +_If you currently support those older Node.js versions and dropping them would be a semver-major change +for you, or if you support older branches of your packages, consider using [Variant 2](#variant-2) +or [Variant 3](#variant-3) on older branches, so people using those older branches will also receive +the fix. That way, you will eradicate potential issues caused by unguarded Buffer API usage and +your users will not observe a runtime deprecation warning when running your code on Node.js 10._ + +<a id="variant-2"></a> +## Variant 2: Use a polyfill + +Utilize [safer-buffer](https://www.npmjs.com/package/safer-buffer) as a polyfill to support older +Node.js versions. + +You would take exacly the same steps as in [Variant 1](#variant-1), but with a polyfill +`const Buffer = require('safer-buffer').Buffer` in all files where you use the new `Buffer` api. + +Make sure that you do not use old `new Buffer` API — in any files where the line above is added, +using old `new Buffer()` API will _throw_. It will be easy to notice that in CI, though. + +Alternatively, you could use [buffer-from](https://www.npmjs.com/package/buffer-from) and/or +[buffer-alloc](https://www.npmjs.com/package/buffer-alloc) [ponyfills](https://ponyfill.com/) — +those are great, the only downsides being 4 deps in the tree and slightly more code changes to +migrate off them (as you would be using e.g. `Buffer.from` under a different name). If you need only +`Buffer.from` polyfilled — `buffer-from` alone which comes with no extra dependencies. + +_Alternatively, you could use [safe-buffer](https://www.npmjs.com/package/safe-buffer) — it also +provides a polyfill, but takes a different approach which has +[it's drawbacks](https://github.com/chalker/safer-buffer#why-not-safe-buffer). It will allow you +to also use the older `new Buffer()` API in your code, though — but that's arguably a benefit, as +it is problematic, can cause issues in your code, and will start emitting runtime deprecation +warnings starting with Node.js 10._ + +Note that in either case, it is important that you also remove all calls to the old Buffer +API manually — just throwing in `safe-buffer` doesn't fix the problem by itself, it just provides +a polyfill for the new API. I have seen people doing that mistake. + +Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +is recommended. + +_Don't forget to drop the polyfill usage once you drop support for Node.js < 4.5.0._ + +<a id="variant-3"></a> +## Variant 3 — manual detection, with safeguards + +This is useful if you create Buffer instances in only a few places (e.g. one), or you have your own +wrapper around them. + +### Buffer(0) + +This special case for creating empty buffers can be safely replaced with `Buffer.concat([])`, which +returns the same result all the way down to Node.js 0.8.x. + +### Buffer(notNumber) + +Before: + +```js +var buf = new Buffer(notNumber, encoding); +``` + +After: + +```js +var buf; +if (Buffer.from && Buffer.from !== Uint8Array.from) { + buf = Buffer.from(notNumber, encoding); +} else { + if (typeof notNumber === 'number') + throw new Error('The "size" argument must be of type number.'); + buf = new Buffer(notNumber, encoding); +} +``` + +`encoding` is optional. + +Note that the `typeof notNumber` before `new Buffer` is required (for cases when `notNumber` argument is not +hard-coded) and _is not caused by the deprecation of Buffer constructor_ — it's exactly _why_ the +Buffer constructor is deprecated. Ecosystem packages lacking this type-check caused numereous +security issues — situations when unsanitized user input could end up in the `Buffer(arg)` create +problems ranging from DoS to leaking sensitive information to the attacker from the process memory. + +When `notNumber` argument is hardcoded (e.g. literal `"abc"` or `[0,1,2]`), the `typeof` check can +be omitted. + +Also note that using TypeScript does not fix this problem for you — when libs written in +`TypeScript` are used from JS, or when user input ends up there — it behaves exactly as pure JS, as +all type checks are translation-time only and are not present in the actual JS code which TS +compiles to. + +### Buffer(number) + +For Node.js 0.10.x (and below) support: + +```js +var buf; +if (Buffer.alloc) { + buf = Buffer.alloc(number); +} else { + buf = new Buffer(number); + buf.fill(0); +} +``` + +Otherwise (Node.js ≥ 0.12.x): + +```js +const buf = Buffer.alloc ? Buffer.alloc(number) : new Buffer(number).fill(0); +``` + +## Regarding Buffer.allocUnsafe + +Be extra cautious when using `Buffer.allocUnsafe`: + * Don't use it if you don't have a good reason to + * e.g. you probably won't ever see a performance difference for small buffers, in fact, those + might be even faster with `Buffer.alloc()`, + * if your code is not in the hot code path — you also probably won't notice a difference, + * keep in mind that zero-filling minimizes the potential risks. + * If you use it, make sure that you never return the buffer in a partially-filled state, + * if you are writing to it sequentially — always truncate it to the actuall written length + +Errors in handling buffers allocated with `Buffer.allocUnsafe` could result in various issues, +ranged from undefined behaviour of your code to sensitive data (user input, passwords, certs) +leaking to the remote attacker. + +_Note that the same applies to `new Buffer` usage without zero-filling, depending on the Node.js +version (and lacking type checks also adds DoS to the list of potential problems)._ + +<a id="faq"></a> +## FAQ + +<a id="design-flaws"></a> +### What is wrong with the `Buffer` constructor? + +The `Buffer` constructor could be used to create a buffer in many different ways: + +- `new Buffer(42)` creates a `Buffer` of 42 bytes. Before Node.js 8, this buffer contained + *arbitrary memory* for performance reasons, which could include anything ranging from + program source code to passwords and encryption keys. +- `new Buffer('abc')` creates a `Buffer` that contains the UTF-8-encoded version of + the string `'abc'`. A second argument could specify another encoding: For example, + `new Buffer(string, 'base64')` could be used to convert a Base64 string into the original + sequence of bytes that it represents. +- There are several other combinations of arguments. + +This meant that, in code like `var buffer = new Buffer(foo);`, *it is not possible to tell +what exactly the contents of the generated buffer are* without knowing the type of `foo`. + +Sometimes, the value of `foo` comes from an external source. For example, this function +could be exposed as a service on a web server, converting a UTF-8 string into its Base64 form: + +``` +function stringToBase64(req, res) { + // The request body should have the format of `{ string: 'foobar' }` + const rawBytes = new Buffer(req.body.string) + const encoded = rawBytes.toString('base64') + res.end({ encoded: encoded }) +} +``` + +Note that this code does *not* validate the type of `req.body.string`: + +- `req.body.string` is expected to be a string. If this is the case, all goes well. +- `req.body.string` is controlled by the client that sends the request. +- If `req.body.string` is the *number* `50`, the `rawBytes` would be 50 bytes: + - Before Node.js 8, the content would be uninitialized + - After Node.js 8, the content would be `50` bytes with the value `0` + +Because of the missing type check, an attacker could intentionally send a number +as part of the request. Using this, they can either: + +- Read uninitialized memory. This **will** leak passwords, encryption keys and other + kinds of sensitive information. (Information leak) +- Force the program to allocate a large amount of memory. For example, when specifying + `500000000` as the input value, each request will allocate 500MB of memory. + This can be used to either exhaust the memory available of a program completely + and make it crash, or slow it down significantly. (Denial of Service) + +Both of these scenarios are considered serious security issues in a real-world +web server context. + +when using `Buffer.from(req.body.string)` instead, passing a number will always +throw an exception instead, giving a controlled behaviour that can always be +handled by the program. + +<a id="ecosystem-usage"></a> +### The `Buffer()` constructor has been deprecated for a while. Is this really an issue? + +Surveys of code in the `npm` ecosystem have shown that the `Buffer()` constructor is still +widely used. This includes new code, and overall usage of such code has actually been +*increasing*. diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/Readme.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/Readme.md new file mode 100644 index 000000000..14b082290 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/Readme.md @@ -0,0 +1,156 @@ +# safer-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![javascript style guide][standard-image]][standard-url] [![Security Responsible Disclosure][secuirty-image]][secuirty-url] + +[travis-image]: https://travis-ci.org/ChALkeR/safer-buffer.svg?branch=master +[travis-url]: https://travis-ci.org/ChALkeR/safer-buffer +[npm-image]: https://img.shields.io/npm/v/safer-buffer.svg +[npm-url]: https://npmjs.org/package/safer-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com +[secuirty-image]: https://img.shields.io/badge/Security-Responsible%20Disclosure-green.svg +[secuirty-url]: https://github.com/nodejs/security-wg/blob/master/processes/responsible_disclosure_template.md + +Modern Buffer API polyfill without footguns, working on Node.js from 0.8 to current. + +## How to use? + +First, port all `Buffer()` and `new Buffer()` calls to `Buffer.alloc()` and `Buffer.from()` API. + +Then, to achieve compatibility with outdated Node.js versions (`<4.5.0` and 5.x `<5.9.0`), use +`const Buffer = require('safer-buffer').Buffer` in all files where you make calls to the new +Buffer API. _Use `var` instead of `const` if you need that for your Node.js version range support._ + +Also, see the +[porting Buffer](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) guide. + +## Do I need it? + +Hopefully, not — dropping support for outdated Node.js versions should be fine nowdays, and that +is the recommended path forward. You _do_ need to port to the `Buffer.alloc()` and `Buffer.from()` +though. + +See the [porting guide](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) +for a better description. + +## Why not [safe-buffer](https://npmjs.com/safe-buffer)? + +_In short: while `safe-buffer` serves as a polyfill for the new API, it allows old API usage and +itself contains footguns._ + +`safe-buffer` could be used safely to get the new API while still keeping support for older +Node.js versions (like this module), but while analyzing ecosystem usage of the old Buffer API +I found out that `safe-buffer` is itself causing problems in some cases. + +For example, consider the following snippet: + +```console +$ cat example.unsafe.js +console.log(Buffer(20)) +$ ./node-v6.13.0-linux-x64/bin/node example.unsafe.js +<Buffer 0a 00 00 00 00 00 00 00 28 13 de 02 00 00 00 00 05 00 00 00> +$ standard example.unsafe.js +standard: Use JavaScript Standard Style (https://standardjs.com) + /home/chalker/repo/safer-buffer/example.unsafe.js:2:13: 'Buffer()' was deprecated since v6. Use 'Buffer.alloc()' or 'Buffer.from()' (use 'https://www.npmjs.com/package/safe-buffer' for '<4.5.0') instead. +``` + +This is allocates and writes to console an uninitialized chunk of memory. +[standard](https://www.npmjs.com/package/standard) linter (among others) catch that and warn people +to avoid using unsafe API. + +Let's now throw in `safe-buffer`! + +```console +$ cat example.safe-buffer.js +const Buffer = require('safe-buffer').Buffer +console.log(Buffer(20)) +$ standard example.safe-buffer.js +$ ./node-v6.13.0-linux-x64/bin/node example.safe-buffer.js +<Buffer 08 00 00 00 00 00 00 00 28 58 01 82 fe 7f 00 00 00 00 00 00> +``` + +See the problem? Adding in `safe-buffer` _magically removes the lint warning_, but the behavior +remains identiсal to what we had before, and when launched on Node.js 6.x LTS — this dumps out +chunks of uninitialized memory. +_And this code will still emit runtime warnings on Node.js 10.x and above._ + +That was done by design. I first considered changing `safe-buffer`, prohibiting old API usage or +emitting warnings on it, but that significantly diverges from `safe-buffer` design. After some +discussion, it was decided to move my approach into a separate package, and _this is that separate +package_. + +This footgun is not imaginary — I observed top-downloaded packages doing that kind of thing, +«fixing» the lint warning by blindly including `safe-buffer` without any actual changes. + +Also in some cases, even if the API _was_ migrated to use of safe Buffer API — a random pull request +can bring unsafe Buffer API usage back to the codebase by adding new calls — and that could go +unnoticed even if you have a linter prohibiting that (becase of the reason stated above), and even +pass CI. _I also observed that being done in popular packages._ + +Some examples: + * [webdriverio](https://github.com/webdriverio/webdriverio/commit/05cbd3167c12e4930f09ef7cf93b127ba4effae4#diff-124380949022817b90b622871837d56cR31) + (a module with 548 759 downloads/month), + * [websocket-stream](https://github.com/maxogden/websocket-stream/commit/c9312bd24d08271687d76da0fe3c83493871cf61) + (218 288 d/m, fix in [maxogden/websocket-stream#142](https://github.com/maxogden/websocket-stream/pull/142)), + * [node-serialport](https://github.com/node-serialport/node-serialport/commit/e8d9d2b16c664224920ce1c895199b1ce2def48c) + (113 138 d/m, fix in [node-serialport/node-serialport#1510](https://github.com/node-serialport/node-serialport/pull/1510)), + * [karma](https://github.com/karma-runner/karma/commit/3d94b8cf18c695104ca195334dc75ff054c74eec) + (3 973 193 d/m, fix in [karma-runner/karma#2947](https://github.com/karma-runner/karma/pull/2947)), + * [spdy-transport](https://github.com/spdy-http2/spdy-transport/commit/5375ac33f4a62a4f65bcfc2827447d42a5dbe8b1) + (5 970 727 d/m, fix in [spdy-http2/spdy-transport#53](https://github.com/spdy-http2/spdy-transport/pull/53)). + * And there are a lot more over the ecosystem. + +I filed a PR at +[mysticatea/eslint-plugin-node#110](https://github.com/mysticatea/eslint-plugin-node/pull/110) to +partially fix that (for cases when that lint rule is used), but it is a semver-major change for +linter rules and presets, so it would take significant time for that to reach actual setups. +_It also hasn't been released yet (2018-03-20)._ + +Also, `safer-buffer` discourages the usage of `.allocUnsafe()`, which is often done by a mistake. +It still supports it with an explicit concern barier, by placing it under +`require('safer-buffer/dangereous')`. + +## But isn't throwing bad? + +Not really. It's an error that could be noticed and fixed early, instead of causing havoc later like +unguarded `new Buffer()` calls that end up receiving user input can do. + +This package affects only the files where `var Buffer = require('safer-buffer').Buffer` was done, so +it is really simple to keep track of things and make sure that you don't mix old API usage with that. +Also, CI should hint anything that you might have missed. + +New commits, if tested, won't land new usage of unsafe Buffer API this way. +_Node.js 10.x also deals with that by printing a runtime depecation warning._ + +### Would it affect third-party modules? + +No, unless you explicitly do an awful thing like monkey-patching or overriding the built-in `Buffer`. +Don't do that. + +### But I don't want throwing… + +That is also fine! + +Also, it could be better in some cases when you don't comprehensive enough test coverage. + +In that case — just don't override `Buffer` and use +`var SaferBuffer = require('safer-buffer').Buffer` instead. + +That way, everything using `Buffer` natively would still work, but there would be two drawbacks: + +* `Buffer.from`/`Buffer.alloc` won't be polyfilled — use `SaferBuffer.from` and + `SaferBuffer.alloc` instead. +* You are still open to accidentally using the insecure deprecated API — use a linter to catch that. + +Note that using a linter to catch accidential `Buffer` constructor usage in this case is strongly +recommended. `Buffer` is not overriden in this usecase, so linters won't get confused. + +## «Without footguns»? + +Well, it is still possible to do _some_ things with `Buffer` API, e.g. accessing `.buffer` property +on older versions and duping things from there. You shouldn't do that in your code, probabably. + +The intention is to remove the most significant footguns that affect lots of packages in the +ecosystem, and to do it in the proper way. + +Also, this package doesn't protect against security issues affecting some Node.js versions, so for +usage in your own production code, it is still recommended to update to a Node.js version +[supported by upstream](https://github.com/nodejs/release#release-schedule). diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/dangerous.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/dangerous.js new file mode 100644 index 000000000..ca41fdc54 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/dangerous.js @@ -0,0 +1,58 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var buffer = require('buffer') +var Buffer = buffer.Buffer +var safer = require('./safer.js') +var Safer = safer.Buffer + +var dangerous = {} + +var key + +for (key in safer) { + if (!safer.hasOwnProperty(key)) continue + dangerous[key] = safer[key] +} + +var Dangereous = dangerous.Buffer = {} + +// Copy Safer API +for (key in Safer) { + if (!Safer.hasOwnProperty(key)) continue + Dangereous[key] = Safer[key] +} + +// Copy those missing unsafe methods, if they are present +for (key in Buffer) { + if (!Buffer.hasOwnProperty(key)) continue + if (Dangereous.hasOwnProperty(key)) continue + Dangereous[key] = Buffer[key] +} + +if (!Dangereous.allocUnsafe) { + Dangereous.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + return Buffer(size) + } +} + +if (!Dangereous.allocUnsafeSlow) { + Dangereous.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + return buffer.SlowBuffer(size) + } +} + +module.exports = dangerous diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/package.json b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/package.json new file mode 100644 index 000000000..f664401d8 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/package.json @@ -0,0 +1,60 @@ +{ + "_from": "safer-buffer@^2.1.0", + "_id": "safer-buffer@2.1.2", + "_inBundle": false, + "_integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "_location": "/libnpmhook/npm-registry-fetch/make-fetch-happen/node-fetch-npm/encoding/iconv-lite/safer-buffer", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "safer-buffer@^2.1.0", + "name": "safer-buffer", + "escapedName": "safer-buffer", + "rawSpec": "^2.1.0", + "saveSpec": null, + "fetchSpec": "^2.1.0" + }, + "_requiredBy": [ + "/libnpmhook/npm-registry-fetch/make-fetch-happen/node-fetch-npm/encoding/iconv-lite" + ], + "_resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "_shasum": "44fa161b0187b9549dd84bb91802f9bd8385cd6a", + "_spec": "safer-buffer@^2.1.0", + "_where": "/Users/rebecca/code/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite", + "author": { + "name": "Nikita Skovoroda", + "email": "chalkerx@gmail.com", + "url": "https://github.com/ChALkeR" + }, + "bugs": { + "url": "https://github.com/ChALkeR/safer-buffer/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Modern Buffer API polyfill without footguns", + "devDependencies": { + "standard": "^11.0.1", + "tape": "^4.9.0" + }, + "files": [ + "Porting-Buffer.md", + "Readme.md", + "tests.js", + "dangerous.js", + "safer.js" + ], + "homepage": "https://github.com/ChALkeR/safer-buffer#readme", + "license": "MIT", + "main": "safer.js", + "name": "safer-buffer", + "repository": { + "type": "git", + "url": "git+https://github.com/ChALkeR/safer-buffer.git" + }, + "scripts": { + "browserify-test": "browserify --external tape tests.js > browserify-tests.js && tape browserify-tests.js", + "test": "standard && tape tests.js" + }, + "version": "2.1.2" +} diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/safer.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/safer.js new file mode 100644 index 000000000..37c7e1aa6 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/safer.js @@ -0,0 +1,77 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var buffer = require('buffer') +var Buffer = buffer.Buffer + +var safer = {} + +var key + +for (key in buffer) { + if (!buffer.hasOwnProperty(key)) continue + if (key === 'SlowBuffer' || key === 'Buffer') continue + safer[key] = buffer[key] +} + +var Safer = safer.Buffer = {} +for (key in Buffer) { + if (!Buffer.hasOwnProperty(key)) continue + if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue + Safer[key] = Buffer[key] +} + +safer.Buffer.prototype = Buffer.prototype + +if (!Safer.from || Safer.from === Uint8Array.from) { + Safer.from = function (value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) + } + if (value && typeof value.length === 'undefined') { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) + } + return Buffer(value, encodingOrOffset, length) + } +} + +if (!Safer.alloc) { + Safer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + var buf = Buffer(size) + if (!fill || fill.length === 0) { + buf.fill(0) + } else if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + return buf + } +} + +if (!safer.kStringMaxLength) { + try { + safer.kStringMaxLength = process.binding('buffer').kStringMaxLength + } catch (e) { + // we can't determine kStringMaxLength in environments where process.binding + // is unsupported, so let's not set it + } +} + +if (!safer.constants) { + safer.constants = { + MAX_LENGTH: safer.kMaxLength + } + if (safer.kStringMaxLength) { + safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength + } +} + +module.exports = safer diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/tests.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/tests.js new file mode 100644 index 000000000..7ed2777c9 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/node_modules/safer-buffer/tests.js @@ -0,0 +1,406 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var test = require('tape') + +var buffer = require('buffer') + +var index = require('./') +var safer = require('./safer') +var dangerous = require('./dangerous') + +/* Inheritance tests */ + +test('Default is Safer', function (t) { + t.equal(index, safer) + t.notEqual(safer, dangerous) + t.notEqual(index, dangerous) + t.end() +}) + +test('Is not a function', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(typeof impl, 'object') + t.equal(typeof impl.Buffer, 'object') + }); + [buffer].forEach(function (impl) { + t.equal(typeof impl, 'object') + t.equal(typeof impl.Buffer, 'function') + }) + t.end() +}) + +test('Constructor throws', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.throws(function () { impl.Buffer() }) + t.throws(function () { impl.Buffer(0) }) + t.throws(function () { impl.Buffer('a') }) + t.throws(function () { impl.Buffer('a', 'utf-8') }) + t.throws(function () { return new impl.Buffer() }) + t.throws(function () { return new impl.Buffer(0) }) + t.throws(function () { return new impl.Buffer('a') }) + t.throws(function () { return new impl.Buffer('a', 'utf-8') }) + }) + t.end() +}) + +test('Safe methods exist', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(typeof impl.Buffer.alloc, 'function', 'alloc') + t.equal(typeof impl.Buffer.from, 'function', 'from') + }) + t.end() +}) + +test('Unsafe methods exist only in Dangerous', function (t) { + [index, safer].forEach(function (impl) { + t.equal(typeof impl.Buffer.allocUnsafe, 'undefined') + t.equal(typeof impl.Buffer.allocUnsafeSlow, 'undefined') + }); + [dangerous].forEach(function (impl) { + t.equal(typeof impl.Buffer.allocUnsafe, 'function') + t.equal(typeof impl.Buffer.allocUnsafeSlow, 'function') + }) + t.end() +}) + +test('Generic methods/properties are defined and equal', function (t) { + ['poolSize', 'isBuffer', 'concat', 'byteLength'].forEach(function (method) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], buffer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Built-in buffer static methods/properties are inherited', function (t) { + Object.keys(buffer).forEach(function (method) { + if (method === 'SlowBuffer' || method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], buffer[method], method) + t.notEqual(typeof impl[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Built-in Buffer static methods/properties are inherited', function (t) { + Object.keys(buffer.Buffer).forEach(function (method) { + if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], buffer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('.prototype property of Buffer is inherited', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.prototype, buffer.Buffer.prototype, 'prototype') + t.notEqual(typeof impl.Buffer.prototype, 'undefined', 'prototype') + }) + t.end() +}) + +test('All Safer methods are present in Dangerous', function (t) { + Object.keys(safer).forEach(function (method) { + if (method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], safer[method], method) + if (method !== 'kStringMaxLength') { + t.notEqual(typeof impl[method], 'undefined', method) + } + }) + }) + Object.keys(safer.Buffer).forEach(function (method) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], safer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Safe methods from Dangerous methods are present in Safer', function (t) { + Object.keys(dangerous).forEach(function (method) { + if (method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], dangerous[method], method) + if (method !== 'kStringMaxLength') { + t.notEqual(typeof impl[method], 'undefined', method) + } + }) + }) + Object.keys(dangerous.Buffer).forEach(function (method) { + if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], dangerous.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +/* Behaviour tests */ + +test('Methods return Buffers', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 10))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 'a'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10, 'x'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(9, 'ab'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(''))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string', 'utf-8'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([0, 42, 3]))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(new Uint8Array([0, 42, 3])))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([]))) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](0))) + t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](10))) + }) + t.end() +}) + +test('Constructor is buffer.Buffer', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.alloc(0).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(0, 10).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(0, 'a').constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(10).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(10, 'x').constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(9, 'ab').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('string').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('string', 'utf-8').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').constructor, buffer.Buffer) + t.equal(impl.Buffer.from([0, 42, 3]).constructor, buffer.Buffer) + t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).constructor, buffer.Buffer) + t.equal(impl.Buffer.from([]).constructor, buffer.Buffer) + }); + [0, 10, 100].forEach(function (arg) { + t.equal(dangerous.Buffer.allocUnsafe(arg).constructor, buffer.Buffer) + t.equal(dangerous.Buffer.allocUnsafeSlow(arg).constructor, buffer.SlowBuffer(0).constructor) + }) + t.end() +}) + +test('Invalid calls throw', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.throws(function () { impl.Buffer.from(0) }) + t.throws(function () { impl.Buffer.from(10) }) + t.throws(function () { impl.Buffer.from(10, 'utf-8') }) + t.throws(function () { impl.Buffer.from('string', 'invalid encoding') }) + t.throws(function () { impl.Buffer.from(-10) }) + t.throws(function () { impl.Buffer.from(1e90) }) + t.throws(function () { impl.Buffer.from(Infinity) }) + t.throws(function () { impl.Buffer.from(-Infinity) }) + t.throws(function () { impl.Buffer.from(NaN) }) + t.throws(function () { impl.Buffer.from(null) }) + t.throws(function () { impl.Buffer.from(undefined) }) + t.throws(function () { impl.Buffer.from() }) + t.throws(function () { impl.Buffer.from({}) }) + t.throws(function () { impl.Buffer.alloc('') }) + t.throws(function () { impl.Buffer.alloc('string') }) + t.throws(function () { impl.Buffer.alloc('string', 'utf-8') }) + t.throws(function () { impl.Buffer.alloc('b25ldHdvdGhyZWU=', 'base64') }) + t.throws(function () { impl.Buffer.alloc(-10) }) + t.throws(function () { impl.Buffer.alloc(1e90) }) + t.throws(function () { impl.Buffer.alloc(2 * (1 << 30)) }) + t.throws(function () { impl.Buffer.alloc(Infinity) }) + t.throws(function () { impl.Buffer.alloc(-Infinity) }) + t.throws(function () { impl.Buffer.alloc(null) }) + t.throws(function () { impl.Buffer.alloc(undefined) }) + t.throws(function () { impl.Buffer.alloc() }) + t.throws(function () { impl.Buffer.alloc([]) }) + t.throws(function () { impl.Buffer.alloc([0, 42, 3]) }) + t.throws(function () { impl.Buffer.alloc({}) }) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.throws(function () { dangerous.Buffer[method]('') }) + t.throws(function () { dangerous.Buffer[method]('string') }) + t.throws(function () { dangerous.Buffer[method]('string', 'utf-8') }) + t.throws(function () { dangerous.Buffer[method](2 * (1 << 30)) }) + t.throws(function () { dangerous.Buffer[method](Infinity) }) + if (dangerous.Buffer[method] === buffer.Buffer.allocUnsafe) { + t.skip('Skipping, older impl of allocUnsafe coerced negative sizes to 0') + } else { + t.throws(function () { dangerous.Buffer[method](-10) }) + t.throws(function () { dangerous.Buffer[method](-1e90) }) + t.throws(function () { dangerous.Buffer[method](-Infinity) }) + } + t.throws(function () { dangerous.Buffer[method](null) }) + t.throws(function () { dangerous.Buffer[method](undefined) }) + t.throws(function () { dangerous.Buffer[method]() }) + t.throws(function () { dangerous.Buffer[method]([]) }) + t.throws(function () { dangerous.Buffer[method]([0, 42, 3]) }) + t.throws(function () { dangerous.Buffer[method]({}) }) + }) + t.end() +}) + +test('Buffers have appropriate lengths', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.alloc(0).length, 0) + t.equal(impl.Buffer.alloc(10).length, 10) + t.equal(impl.Buffer.from('').length, 0) + t.equal(impl.Buffer.from('string').length, 6) + t.equal(impl.Buffer.from('string', 'utf-8').length, 6) + t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').length, 11) + t.equal(impl.Buffer.from([0, 42, 3]).length, 3) + t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).length, 3) + t.equal(impl.Buffer.from([]).length, 0) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.equal(dangerous.Buffer[method](0).length, 0) + t.equal(dangerous.Buffer[method](10).length, 10) + }) + t.end() +}) + +test('Buffers have appropriate lengths (2)', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true; + [ safer.Buffer.alloc, + dangerous.Buffer.allocUnsafe, + dangerous.Buffer.allocUnsafeSlow + ].forEach(function (method) { + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 1e5) + var buf = method(length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + } + }) + t.ok(ok) + t.end() +}) + +test('.alloc(size) is zero-filled and has correct length', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var buf = index.Buffer.alloc(length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + var j + for (j = 0; j < length; j++) { + if (buf[j] !== 0) ok = false + } + buf.fill(1) + for (j = 0; j < length; j++) { + if (buf[j] !== 1) ok = false + } + } + t.ok(ok) + t.end() +}) + +test('.allocUnsafe / .allocUnsafeSlow are fillable and have correct lengths', function (t) { + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var buf = dangerous.Buffer[method](length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + buf.fill(0, 0, length) + var j + for (j = 0; j < length; j++) { + if (buf[j] !== 0) ok = false + } + buf.fill(1, 0, length) + for (j = 0; j < length; j++) { + if (buf[j] !== 1) ok = false + } + } + t.ok(ok, method) + }) + t.end() +}) + +test('.alloc(size, fill) is `fill`-filled', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var fill = Math.round(Math.random() * 255) + var buf = index.Buffer.alloc(length, fill) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + for (var j = 0; j < length; j++) { + if (buf[j] !== fill) ok = false + } + } + t.ok(ok) + t.end() +}) + +test('.alloc(size, fill) is `fill`-filled', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var fill = Math.round(Math.random() * 255) + var buf = index.Buffer.alloc(length, fill) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + for (var j = 0; j < length; j++) { + if (buf[j] !== fill) ok = false + } + } + t.ok(ok) + t.deepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 97)) + t.notDeepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 98)) + + var tmp = new buffer.Buffer(2) + tmp.fill('ok') + if (tmp[1] === tmp[0]) { + // Outdated Node.js + t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('ooooo')) + } else { + t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('okoko')) + } + t.notDeepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('kokok')) + + t.end() +}) + +test('safer.Buffer.from returns results same as Buffer constructor', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.deepEqual(impl.Buffer.from(''), new buffer.Buffer('')) + t.deepEqual(impl.Buffer.from('string'), new buffer.Buffer('string')) + t.deepEqual(impl.Buffer.from('string', 'utf-8'), new buffer.Buffer('string', 'utf-8')) + t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), new buffer.Buffer('b25ldHdvdGhyZWU=', 'base64')) + t.deepEqual(impl.Buffer.from([0, 42, 3]), new buffer.Buffer([0, 42, 3])) + t.deepEqual(impl.Buffer.from(new Uint8Array([0, 42, 3])), new buffer.Buffer(new Uint8Array([0, 42, 3]))) + t.deepEqual(impl.Buffer.from([]), new buffer.Buffer([])) + }) + t.end() +}) + +test('safer.Buffer.from returns consistent results', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.deepEqual(impl.Buffer.from(''), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from([]), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from(new Uint8Array([])), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from('string', 'utf-8'), impl.Buffer.from('string')) + t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from([115, 116, 114, 105, 110, 103])) + t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from(impl.Buffer.from('string'))) + t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), impl.Buffer.from('onetwothree')) + t.notDeepEqual(impl.Buffer.from('b25ldHdvdGhyZWU='), impl.Buffer.from('onetwothree')) + }) + t.end() +}) diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/package.json b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/package.json index b8e68fb36..4ad2febf9 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/package.json +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding/node_modules/iconv-lite/package.json @@ -1,101 +1,51 @@ { - "_args": [ - [ - "iconv-lite@0.4.19", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_from": "iconv-lite@0.4.19", - "_id": "iconv-lite@0.4.19", + "_from": "iconv-lite@~0.4.13", + "_id": "iconv-lite@0.4.21", "_inBundle": false, - "_integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", + "_integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", "_location": "/libnpmhook/npm-registry-fetch/make-fetch-happen/node-fetch-npm/encoding/iconv-lite", "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "range", "registry": true, - "raw": "iconv-lite@0.4.19", + "raw": "iconv-lite@~0.4.13", "name": "iconv-lite", "escapedName": "iconv-lite", - "rawSpec": "0.4.19", + "rawSpec": "~0.4.13", "saveSpec": null, - "fetchSpec": "0.4.19" + "fetchSpec": "~0.4.13" }, "_requiredBy": [ "/libnpmhook/npm-registry-fetch/make-fetch-happen/node-fetch-npm/encoding" ], - "_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "_spec": "0.4.19", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.21.tgz", + "_shasum": "c47f8733d02171189ebc4a400f3218d348094798", + "_spec": "iconv-lite@~0.4.13", + "_where": "/Users/rebecca/code/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/encoding", "author": { "name": "Alexander Shtuchkin", "email": "ashtuchkin@gmail.com" }, "browser": { - "./extend-node": false, - "./streams": false + "./lib/extend-node": false, + "./lib/streams": false }, "bugs": { "url": "https://github.com/ashtuchkin/iconv-lite/issues" }, - "contributors": [ - { - "name": "Jinwu Zhan", - "url": "https://github.com/jenkinv" - }, - { - "name": "Adamansky Anton", - "url": "https://github.com/adamansky" - }, - { - "name": "George Stagas", - "url": "https://github.com/stagas" - }, - { - "name": "Mike D Pilsbury", - "url": "https://github.com/pekim" - }, - { - "name": "Niggler", - "url": "https://github.com/Niggler" - }, - { - "name": "wychi", - "url": "https://github.com/wychi" - }, - { - "name": "David Kuo", - "url": "https://github.com/david50407" - }, - { - "name": "ChangZhuo Chen", - "url": "https://github.com/czchen" - }, - { - "name": "Lee Treveil", - "url": "https://github.com/leetreveil" - }, - { - "name": "Brian White", - "url": "https://github.com/mscdex" - }, - { - "name": "Mithgol", - "url": "https://github.com/Mithgol" - }, - { - "name": "Nazar Leush", - "url": "https://github.com/nleush" - } - ], + "bundleDependencies": false, + "dependencies": { + "safer-buffer": "^2.1.0" + }, + "deprecated": false, "description": "Convert character encodings in pure javascript.", "devDependencies": { "async": "*", "errto": "*", "iconv": "*", "istanbul": "*", - "mocha": "*", - "request": "*", + "mocha": "^3.1.0", + "request": "~2.81.0", "semver": "*", "unorm": "*" }, @@ -122,5 +72,5 @@ "test": "mocha --reporter spec --grep ." }, "typings": "./lib/index.d.ts", - "version": "0.4.19" + "version": "0.4.21" } diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/.npmignore b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/.npmignore new file mode 100644 index 000000000..e7726a071 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/.npmignore @@ -0,0 +1,2 @@ +/node_modules/* +npm-debug.log diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/License b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/License new file mode 100644 index 000000000..0b58de379 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/License @@ -0,0 +1,21 @@ +Copyright (c) 2011: +Tim Koschützki (tim@debuggable.com) +Felix Geisendörfer (felix@debuggable.com) + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/Makefile b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/Makefile new file mode 100644 index 000000000..eee21a99d --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/Makefile @@ -0,0 +1,22 @@ +SHELL := /bin/bash + +test: + @node test/runner.js + +release-major: test + npm version major -m "Release %s" + git push + npm publish + +release-minor: test + npm version minor -m "Release %s" + git push + npm publish + +release-patch: test + npm version patch -m "Release %s" + git push + npm publish + +.PHONY: test + diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/README.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/README.md new file mode 100644 index 000000000..eee05f7bb --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/README.md @@ -0,0 +1,215 @@ +# retry + +Abstraction for exponential and custom retry strategies for failed operations. + +## Installation + + npm install retry + +## Current Status + +This module has been tested and is ready to be used. + +## Tutorial + +The example below will retry a potentially failing `dns.resolve` operation +`10` times using an exponential backoff strategy. With the default settings, this +means the last attempt is made after `17 minutes and 3 seconds`. + +``` javascript +var dns = require('dns'); +var retry = require('retry'); + +function faultTolerantResolve(address, cb) { + var operation = retry.operation(); + + operation.attempt(function(currentAttempt) { + dns.resolve(address, function(err, addresses) { + if (operation.retry(err)) { + return; + } + + cb(err ? operation.mainError() : null, addresses); + }); + }); +} + +faultTolerantResolve('nodejs.org', function(err, addresses) { + console.log(err, addresses); +}); +``` + +Of course you can also configure the factors that go into the exponential +backoff. See the API documentation below for all available settings. +currentAttempt is an int representing the number of attempts so far. + +``` javascript +var operation = retry.operation({ + retries: 5, + factor: 3, + minTimeout: 1 * 1000, + maxTimeout: 60 * 1000, + randomize: true, +}); +``` + +## API + +### retry.operation([options]) + +Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with two additions: + +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. + +### retry.timeouts([options]) + +Returns an array of timeouts. All time `options` and return values are in +milliseconds. If `options` is an array, a copy of that array is returned. + +`options` is a JS object that can contain any of the following keys: + +* `retries`: The maximum amount of times to retry the operation. Default is `10`. +* `factor`: The exponential factor to use. Default is `2`. +* `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`. +* `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`. +* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`. + +The formula used to calculate the individual timeouts is: + +``` +Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout) +``` + +Have a look at [this article][article] for a better explanation of approach. + +If you want to tune your `factor` / `times` settings to attempt the last retry +after a certain amount of time, you can use wolfram alpha. For example in order +to tune for `10` attempts in `5 minutes`, you can use this equation: + +![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif) + +Explaining the various values from left to right: + +* `k = 0 ... 9`: The `retries` value (10) +* `1000`: The `minTimeout` value in ms (1000) +* `x^k`: No need to change this, `x` will be your resulting factor +* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes) + +To make this a little easier for you, use wolfram alpha to do the calculations: + +<http://www.wolframalpha.com/input/?i=Sum%5B1000*x^k%2C+{k%2C+0%2C+9}%5D+%3D+5+*+60+*+1000> + +[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html + +### retry.createTimeout(attempt, opts) + +Returns a new `timeout` (integer in milliseconds) based on the given parameters. + +`attempt` is an integer representing for which retry the timeout should be calculated. If your retry operation was executed 4 times you had one attempt and 3 retries. If you then want to calculate a new timeout, you should set `attempt` to 4 (attempts are zero-indexed). + +`opts` can include `factor`, `minTimeout`, `randomize` (boolean) and `maxTimeout`. They are documented above. + +`retry.createTimeout()` is used internally by `retry.timeouts()` and is public for you to be able to create your own timeouts for reinserting an item, see [issue #13](https://github.com/tim-kos/node-retry/issues/13). + +### retry.wrap(obj, [options], [methodNames]) + +Wrap all functions of the `obj` with retry. Optionally you can pass operation options and +an array of method names which need to be wrapped. + +``` +retry.wrap(obj) + +retry.wrap(obj, ['method1', 'method2']) + +retry.wrap(obj, {retries: 3}) + +retry.wrap(obj, {retries: 3}, ['method1', 'method2']) +``` +The `options` object can take any options that the usual call to `retry.operation` can take. + +### new RetryOperation(timeouts, [options]) + +Creates a new `RetryOperation` where `timeouts` is an array where each value is +a timeout given in milliseconds. + +Available options: +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. + +If `forever` is true, the following changes happen: +* `RetryOperation.errors()` will only output an array of one item: the last error. +* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on. + +#### retryOperation.errors() + +Returns an array of all errors that have been passed to +`retryOperation.retry()` so far. + +#### retryOperation.mainError() + +A reference to the error object that occured most frequently. Errors are +compared using the `error.message` property. + +If multiple error messages occured the same amount of time, the last error +object with that message is returned. + +If no errors occured so far, the value is `null`. + +#### retryOperation.attempt(fn, timeoutOps) + +Defines the function `fn` that is to be retried and executes it for the first +time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far. + +Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function. +Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called. + + +#### retryOperation.try(fn) + +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. + +#### retryOperation.start(fn) + +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. + +#### retryOperation.retry(error) + +Returns `false` when no `error` value is given, or the maximum amount of retries +has been reached. + +Otherwise it returns `true`, and retries the operation after the timeout for +the current attempt number. + +#### retryOperation.stop() + +Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. + +#### retryOperation.attempts() + +Returns an int representing the number of attempts it took to call `fn` before it was successful. + +## License + +retry is licensed under the MIT license. + + +# Changelog + +0.10.0 Adding `stop` functionality, thanks to @maxnachlinger. + +0.9.0 Adding `unref` functionality, thanks to @satazor. + +0.8.0 Implementing retry.wrap. + +0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). + +0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. + +0.5.0 Some minor refactoring. + +0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. + +0.3.0 Added retryOperation.start() which is an alias for retryOperation.try(). + +0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn(). diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/equation.gif b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/equation.gif Binary files differnew file mode 100644 index 000000000..97107237b --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/equation.gif diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/example/dns.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/example/dns.js new file mode 100644 index 000000000..446729b6f --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/example/dns.js @@ -0,0 +1,31 @@ +var dns = require('dns'); +var retry = require('../lib/retry'); + +function faultTolerantResolve(address, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + dns.resolve(address, function(err, addresses) { + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), addresses); + }); + }); +} + +faultTolerantResolve('nodejs.org', function(err, errors, addresses) { + console.warn('err:'); + console.log(err); + + console.warn('addresses:'); + console.log(addresses); +});
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/example/stop.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/example/stop.js new file mode 100644 index 000000000..e1ceafeeb --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/example/stop.js @@ -0,0 +1,40 @@ +var retry = require('../lib/retry'); + +function attemptAsyncOperation(someInput, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + failingAsyncOperation(someInput, function(err, result) { + + if (err && err.message === 'A fatal error') { + operation.stop(); + return cb(err); + } + + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), result); + }); + }); +} + +attemptAsyncOperation('test input', function(err, errors, result) { + console.warn('err:'); + console.log(err); + + console.warn('result:'); + console.log(result); +}); + +function failingAsyncOperation(input, cb) { + return setImmediate(cb.bind(null, new Error('A fatal error'))); +} diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/index.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/index.js new file mode 100644 index 000000000..ee62f3a11 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/retry');
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/lib/retry.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/lib/retry.js new file mode 100644 index 000000000..77428cfd0 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/lib/retry.js @@ -0,0 +1,99 @@ +var RetryOperation = require('./retry_operation'); + +exports.operation = function(options) { + var timeouts = exports.timeouts(options); + return new RetryOperation(timeouts, { + forever: options && options.forever, + unref: options && options.unref + }); +}; + +exports.timeouts = function(options) { + if (options instanceof Array) { + return [].concat(options); + } + + var opts = { + retries: 10, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: Infinity, + randomize: false + }; + for (var key in options) { + opts[key] = options[key]; + } + + if (opts.minTimeout > opts.maxTimeout) { + throw new Error('minTimeout is greater than maxTimeout'); + } + + var timeouts = []; + for (var i = 0; i < opts.retries; i++) { + timeouts.push(this.createTimeout(i, opts)); + } + + if (options && options.forever && !timeouts.length) { + timeouts.push(this.createTimeout(i, opts)); + } + + // sort the array numerically ascending + timeouts.sort(function(a,b) { + return a - b; + }); + + return timeouts; +}; + +exports.createTimeout = function(attempt, opts) { + var random = (opts.randomize) + ? (Math.random() + 1) + : 1; + + var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); + timeout = Math.min(timeout, opts.maxTimeout); + + return timeout; +}; + +exports.wrap = function(obj, options, methods) { + if (options instanceof Array) { + methods = options; + options = null; + } + + if (!methods) { + methods = []; + for (var key in obj) { + if (typeof obj[key] === 'function') { + methods.push(key); + } + } + } + + for (var i = 0; i < methods.length; i++) { + var method = methods[i]; + var original = obj[method]; + + obj[method] = function retryWrapper() { + var op = exports.operation(options); + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + + args.push(function(err) { + if (op.retry(err)) { + return; + } + if (err) { + arguments[0] = op.mainError(); + } + callback.apply(this, arguments); + }); + + op.attempt(function() { + original.apply(obj, args); + }); + }; + obj[method].options = options; + } +}; diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/lib/retry_operation.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/lib/retry_operation.js new file mode 100644 index 000000000..2b3db8e17 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/lib/retry_operation.js @@ -0,0 +1,143 @@ +function RetryOperation(timeouts, options) { + // Compatibility for the old (timeouts, retryForever) signature + if (typeof options === 'boolean') { + options = { forever: options }; + } + + this._timeouts = timeouts; + this._options = options || {}; + this._fn = null; + this._errors = []; + this._attempts = 1; + this._operationTimeout = null; + this._operationTimeoutCb = null; + this._timeout = null; + + if (this._options.forever) { + this._cachedTimeouts = this._timeouts.slice(0); + } +} +module.exports = RetryOperation; + +RetryOperation.prototype.stop = function() { + if (this._timeout) { + clearTimeout(this._timeout); + } + + this._timeouts = []; + this._cachedTimeouts = null; +}; + +RetryOperation.prototype.retry = function(err) { + if (this._timeout) { + clearTimeout(this._timeout); + } + + if (!err) { + return false; + } + + this._errors.push(err); + + var timeout = this._timeouts.shift(); + if (timeout === undefined) { + if (this._cachedTimeouts) { + // retry forever, only keep last error + this._errors.splice(this._errors.length - 1, this._errors.length); + this._timeouts = this._cachedTimeouts.slice(0); + timeout = this._timeouts.shift(); + } else { + return false; + } + } + + var self = this; + var timer = setTimeout(function() { + self._attempts++; + + if (self._operationTimeoutCb) { + self._timeout = setTimeout(function() { + self._operationTimeoutCb(self._attempts); + }, self._operationTimeout); + + if (this._options.unref) { + self._timeout.unref(); + } + } + + self._fn(self._attempts); + }, timeout); + + if (this._options.unref) { + timer.unref(); + } + + return true; +}; + +RetryOperation.prototype.attempt = function(fn, timeoutOps) { + this._fn = fn; + + if (timeoutOps) { + if (timeoutOps.timeout) { + this._operationTimeout = timeoutOps.timeout; + } + if (timeoutOps.cb) { + this._operationTimeoutCb = timeoutOps.cb; + } + } + + var self = this; + if (this._operationTimeoutCb) { + this._timeout = setTimeout(function() { + self._operationTimeoutCb(); + }, self._operationTimeout); + } + + this._fn(this._attempts); +}; + +RetryOperation.prototype.try = function(fn) { + console.log('Using RetryOperation.try() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = function(fn) { + console.log('Using RetryOperation.start() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = RetryOperation.prototype.try; + +RetryOperation.prototype.errors = function() { + return this._errors; +}; + +RetryOperation.prototype.attempts = function() { + return this._attempts; +}; + +RetryOperation.prototype.mainError = function() { + if (this._errors.length === 0) { + return null; + } + + var counts = {}; + var mainError = null; + var mainErrorCount = 0; + + for (var i = 0; i < this._errors.length; i++) { + var error = this._errors[i]; + var message = error.message; + var count = (counts[message] || 0) + 1; + + counts[message] = count; + + if (count >= mainErrorCount) { + mainError = error; + mainErrorCount = count; + } + } + + return mainError; +}; diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/package.json b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/package.json new file mode 100644 index 000000000..1e6246755 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/package.json @@ -0,0 +1,56 @@ +{ + "_from": "retry@^0.10.0", + "_id": "retry@0.10.1", + "_inBundle": false, + "_integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", + "_location": "/libnpmhook/npm-registry-fetch/make-fetch-happen/promise-retry/retry", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "retry@^0.10.0", + "name": "retry", + "escapedName": "retry", + "rawSpec": "^0.10.0", + "saveSpec": null, + "fetchSpec": "^0.10.0" + }, + "_requiredBy": [ + "/libnpmhook/npm-registry-fetch/make-fetch-happen/promise-retry" + ], + "_resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", + "_shasum": "e76388d217992c252750241d3d3956fed98d8ff4", + "_spec": "retry@^0.10.0", + "_where": "/Users/rebecca/code/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry", + "author": { + "name": "Tim Koschützki", + "email": "tim@debuggable.com", + "url": "http://debuggable.com/" + }, + "bugs": { + "url": "https://github.com/tim-kos/node-retry/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Abstraction for exponential and custom retry strategies for failed operations.", + "devDependencies": { + "fake": "0.2.0", + "far": "0.0.1" + }, + "directories": { + "lib": "./lib" + }, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/tim-kos/node-retry", + "license": "MIT", + "main": "index", + "name": "retry", + "repository": { + "type": "git", + "url": "git://github.com/tim-kos/node-retry.git" + }, + "version": "0.10.1" +} diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/common.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/common.js new file mode 100644 index 000000000..224720696 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/common.js @@ -0,0 +1,10 @@ +var common = module.exports; +var path = require('path'); + +var rootDir = path.join(__dirname, '..'); +common.dir = { + lib: rootDir + '/lib' +}; + +common.assert = require('assert'); +common.fake = require('fake');
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/integration/test-forever.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/integration/test-forever.js new file mode 100644 index 000000000..b41307cb5 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/integration/test-forever.js @@ -0,0 +1,24 @@ +var common = require('../common'); +var assert = common.assert; +var retry = require(common.dir.lib + '/retry'); + +(function testForeverUsesFirstTimeout() { + var operation = retry.operation({ + retries: 0, + minTimeout: 100, + maxTimeout: 100, + forever: true + }); + + operation.attempt(function(numAttempt) { + console.log('>numAttempt', numAttempt); + var err = new Error("foo"); + if (numAttempt == 10) { + operation.stop(); + } + + if (operation.retry(err)) { + return; + } + }); +})(); diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-operation.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-operation.js new file mode 100644 index 000000000..916936424 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-operation.js @@ -0,0 +1,176 @@ +var common = require('../common'); +var assert = common.assert; +var fake = common.fake.create(); +var retry = require(common.dir.lib + '/retry'); + +(function testErrors() { + var operation = retry.operation(); + + var error = new Error('some error'); + var error2 = new Error('some other error'); + operation._errors.push(error); + operation._errors.push(error2); + + assert.deepEqual(operation.errors(), [error, error2]); +})(); + +(function testMainErrorReturnsMostFrequentError() { + var operation = retry.operation(); + var error = new Error('some error'); + var error2 = new Error('some other error'); + + operation._errors.push(error); + operation._errors.push(error2); + operation._errors.push(error); + + assert.strictEqual(operation.mainError(), error); +})(); + +(function testMainErrorReturnsLastErrorOnEqualCount() { + var operation = retry.operation(); + var error = new Error('some error'); + var error2 = new Error('some other error'); + + operation._errors.push(error); + operation._errors.push(error2); + + assert.strictEqual(operation.mainError(), error2); +})(); + +(function testAttempt() { + var operation = retry.operation(); + var fn = new Function(); + + var timeoutOpts = { + timeout: 1, + cb: function() {} + }; + operation.attempt(fn, timeoutOpts); + + assert.strictEqual(fn, operation._fn); + assert.strictEqual(timeoutOpts.timeout, operation._operationTimeout); + assert.strictEqual(timeoutOpts.cb, operation._operationTimeoutCb); +})(); + +(function testRetry() { + var times = 3; + var error = new Error('some error'); + var operation = retry.operation([1, 2, 3]); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (operation.retry(error)) { + return; + } + + assert.strictEqual(attempts, 4); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testRetryForever() { + var error = new Error('some error'); + var operation = retry.operation({ retries: 3, forever: true }); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (attempts !== 6 && operation.retry(error)) { + return; + } + + assert.strictEqual(attempts, 6); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testRetryForeverNoRetries() { + var error = new Error('some error'); + var delay = 50 + var operation = retry.operation({ + retries: null, + forever: true, + minTimeout: delay, + maxTimeout: delay + }); + + var attempts = 0; + var startTime = new Date().getTime(); + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (attempts !== 4 && operation.retry(error)) { + return; + } + + var endTime = new Date().getTime(); + var minTime = startTime + (delay * 3); + var maxTime = minTime + 20 // add a little headroom for code execution time + assert(endTime > minTime) + assert(endTime < maxTime) + assert.strictEqual(attempts, 4); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testStop() { + var error = new Error('some error'); + var operation = retry.operation([1, 2, 3]); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + + if (attempts === 2) { + operation.stop(); + + assert.strictEqual(attempts, 2); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + } + + if (operation.retry(error)) { + return; + } + }); + }; + + fn(); +})(); diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-wrap.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-wrap.js new file mode 100644 index 000000000..7ca8bc7eb --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-wrap.js @@ -0,0 +1,77 @@ +var common = require('../common'); +var assert = common.assert; +var fake = common.fake.create(); +var retry = require(common.dir.lib + '/retry'); + +function getLib() { + return { + fn1: function() {}, + fn2: function() {}, + fn3: function() {} + }; +} + +(function wrapAll() { + var lib = getLib(); + retry.wrap(lib); + assert.equal(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); +}()); + +(function wrapAllPassOptions() { + var lib = getLib(); + retry.wrap(lib, {retries: 2}); + assert.equal(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); + assert.equal(lib.fn1.options.retries, 2); + assert.equal(lib.fn2.options.retries, 2); + assert.equal(lib.fn3.options.retries, 2); +}()); + +(function wrapDefined() { + var lib = getLib(); + retry.wrap(lib, ['fn2', 'fn3']); + assert.notEqual(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); +}()); + +(function wrapDefinedAndPassOptions() { + var lib = getLib(); + retry.wrap(lib, {retries: 2}, ['fn2', 'fn3']); + assert.notEqual(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); + assert.equal(lib.fn2.options.retries, 2); + assert.equal(lib.fn3.options.retries, 2); +}()); + +(function runWrappedWithoutError() { + var callbackCalled; + var lib = {method: function(a, b, callback) { + assert.equal(a, 1); + assert.equal(b, 2); + assert.equal(typeof callback, 'function'); + callback(); + }}; + retry.wrap(lib); + lib.method(1, 2, function() { + callbackCalled = true; + }); + assert.ok(callbackCalled); +}()); + +(function runWrappedWithError() { + var callbackCalled; + var lib = {method: function(callback) { + callback(new Error('Some error')); + }}; + retry.wrap(lib, {retries: 1}); + lib.method(function(err) { + callbackCalled = true; + assert.ok(err instanceof Error); + }); + assert.ok(!callbackCalled); +}()); diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/integration/test-timeouts.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/integration/test-timeouts.js new file mode 100644 index 000000000..7206b0fb0 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/integration/test-timeouts.js @@ -0,0 +1,69 @@ +var common = require('../common'); +var assert = common.assert; +var retry = require(common.dir.lib + '/retry'); + +(function testDefaultValues() { + var timeouts = retry.timeouts(); + + assert.equal(timeouts.length, 10); + assert.equal(timeouts[0], 1000); + assert.equal(timeouts[1], 2000); + assert.equal(timeouts[2], 4000); +})(); + +(function testDefaultValuesWithRandomize() { + var minTimeout = 5000; + var timeouts = retry.timeouts({ + minTimeout: minTimeout, + randomize: true + }); + + assert.equal(timeouts.length, 10); + assert.ok(timeouts[0] > minTimeout); + assert.ok(timeouts[1] > timeouts[0]); + assert.ok(timeouts[2] > timeouts[1]); +})(); + +(function testPassedTimeoutsAreUsed() { + var timeoutsArray = [1000, 2000, 3000]; + var timeouts = retry.timeouts(timeoutsArray); + assert.deepEqual(timeouts, timeoutsArray); + assert.notStrictEqual(timeouts, timeoutsArray); +})(); + +(function testTimeoutsAreWithinBoundaries() { + var minTimeout = 1000; + var maxTimeout = 10000; + var timeouts = retry.timeouts({ + minTimeout: minTimeout, + maxTimeout: maxTimeout + }); + for (var i = 0; i < timeouts; i++) { + assert.ok(timeouts[i] >= minTimeout); + assert.ok(timeouts[i] <= maxTimeout); + } +})(); + +(function testTimeoutsAreIncremental() { + var timeouts = retry.timeouts(); + var lastTimeout = timeouts[0]; + for (var i = 0; i < timeouts; i++) { + assert.ok(timeouts[i] > lastTimeout); + lastTimeout = timeouts[i]; + } +})(); + +(function testTimeoutsAreIncrementalForFactorsLessThanOne() { + var timeouts = retry.timeouts({ + retries: 3, + factor: 0.5 + }); + + var expected = [250, 500, 1000]; + assert.deepEqual(expected, timeouts); +})(); + +(function testRetries() { + var timeouts = retry.timeouts({retries: 2}); + assert.strictEqual(timeouts.length, 2); +})(); diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/runner.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/runner.js new file mode 100644 index 000000000..e0ee2f570 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/promise-retry/node_modules/retry/test/runner.js @@ -0,0 +1,5 @@ +var far = require('far').create(); + +far.add(__dirname); +far.include(/\/test-.*\.js$/); +far.execute(); diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.npmignore b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.npmignore deleted file mode 100644 index 07e6e472c..000000000 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.travis.yml b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.travis.yml index 805d3d50d..1ff82daa2 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.travis.yml +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.travis.yml @@ -3,11 +3,10 @@ sudo: false language: node_js node_js: - - "4" - - "5" - "6" - "7" - "8" + - "9" install: - PATH="`npm bin`:`npm bin -g`:$PATH" diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/index.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/index.js index 3dac18d56..b01be0304 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/index.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/index.js @@ -6,7 +6,7 @@ var tls; // lazy-loaded... var url = require('url'); var dns = require('dns'); var Agent = require('agent-base'); -var SocksClient = require('socks'); +var SocksClient = require('socks').SocksClient; var inherits = require('util').inherits; /** @@ -90,7 +90,9 @@ SocksProxyAgent.prototype.callback = 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) { + function onhostconnect(err, result) { + var socket = result.socket + if (err) return fn(err); var s = socket; if (opts.secureEndpoint) { @@ -104,14 +106,14 @@ SocksProxyAgent.prototype.callback = function connect(req, opts, fn) { opts.port = null; s = tls.connect(opts); } - socket.resume(); + fn(null, s); } // called for the `dns.lookup()` callback function onlookup(err, ip) { if (err) return fn(err); - options.target.host = ip; + options.destination.host = ip; SocksClient.createConnection(options, onhostconnect); } @@ -121,11 +123,12 @@ SocksProxyAgent.prototype.callback = function connect(req, opts, fn) { port: +proxy.port, type: proxy.version }, - target: { + destination: { port: +opts.port }, command: 'connect' }; + if (proxy.authentication) { options.proxy.authentication = proxy.authentication; options.proxy.userid = proxy.userid; diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/History.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/History.md index 80c88dc40..e12180e42 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/History.md +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/History.md @@ -1,12 +1,4 @@ -4.2.0 / 2018-01-15 -================== - - * Add support for returning an `http.Agent` instance - * Optimize promisifying logic - * Set `timeout` to null for proper cleanup - * Remove Node.js <= 0.11.3 special-casing from test case - 4.1.2 / 2017-11-20 ================== diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/README.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/README.md index dbeceab8a..64175a43a 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/README.md +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/README.md @@ -63,7 +63,7 @@ http.get(parsed, function (res) { }); ``` -Returning a Promise or using an `async` function is also supported: +You can also return a Promise or use an `async` function: ```js agent(async function (req, opts) { @@ -72,15 +72,6 @@ agent(async function (req, opts) { }); ``` -Return another `http.Agent` instance to "pass through" the responsibility -for that HTTP request to that agent: - -```js -agent(function (req, opts) { - return opts.secureEndpoint ? https.globalAgent : http.globalAgent; -}); -``` - API --- diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/index.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/index.js index b1f42e631..df3ca727a 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/index.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/index.js @@ -1,14 +1,19 @@ 'use strict'; + +/** + * Module dependencies. + */ + require('./patch-core'); const inherits = require('util').inherits; const promisify = require('es6-promisify'); const EventEmitter = require('events').EventEmitter; -module.exports = Agent; +/** + * Module exports. + */ -function isAgent(v) { - return v && typeof v.addRequest === 'function'; -} +module.exports = Agent; /** * Base `http.Agent` implementation. @@ -17,6 +22,7 @@ function isAgent(v) { * @param {Function} callback * @api public */ + function Agent(callback, _opts) { if (!(this instanceof Agent)) { return new Agent(callback, _opts); @@ -24,10 +30,6 @@ function Agent(callback, _opts) { EventEmitter.call(this); - // The callback gets promisified if it has 3 parameters - // (i.e. it has a callback function) lazily - this._promisifiedCallback = false; - let opts = _opts; if ('function' === typeof callback) { this.callback = callback; @@ -57,15 +59,19 @@ Agent.prototype.callback = function callback(req, opts) { * * @api public */ -Agent.prototype.addRequest = function addRequest(req, _opts) { + +Agent.prototype.addRequest = function addRequest( + req, + _opts +) { const ownOpts = Object.assign({}, _opts); - // Set default `host` for HTTP to localhost + // set default `host` for HTTP to localhost if (null == ownOpts.host) { ownOpts.host = 'localhost'; } - // Set default `port` for HTTP if none was explicitly specified + // set default `port` for HTTP if none was explicitly specified if (null == ownOpts.port) { ownOpts.port = ownOpts.secureEndpoint ? 443 : 80; } @@ -73,7 +79,7 @@ Agent.prototype.addRequest = function addRequest(req, _opts) { const opts = Object.assign({}, this.options, ownOpts); if (opts.host && opts.path) { - // If both a `host` and `path` are specified then it's most likely the + // 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; @@ -85,12 +91,12 @@ Agent.prototype.addRequest = function addRequest(req, _opts) { delete opts.defaultPort; delete opts.createConnection; - // Hint to use "Connection: close" + // hint to use "Connection: close" // XXX: non-documented `http` module API :( req._last = true; req.shouldKeepAlive = false; - // Create the `stream.Duplex` instance + // create the `stream.Duplex` instance let timeout; let timedOut = false; const timeoutMs = this.timeout; @@ -104,7 +110,6 @@ Agent.prototype.addRequest = function addRequest(req, _opts) { } function ontimeout() { - timeout = null; timedOut = true; const err = new Error( 'A "socket" was not created for HTTP request before ' + timeoutMs + 'ms' @@ -117,7 +122,6 @@ Agent.prototype.addRequest = function addRequest(req, _opts) { if (timedOut) return; if (timeout != null) { clearTimeout(timeout); - timeout = null; } onerror(err); } @@ -126,26 +130,18 @@ Agent.prototype.addRequest = function addRequest(req, _opts) { if (timedOut) return; if (timeout != null) { clearTimeout(timeout); - timeout = null; } - if (isAgent(socket)) { - // `socket` is actually an http.Agent instance, so relinquish - // responsibility for this `req` to the Agent from here on - socket.addRequest(req, opts); - } else if (socket) { + if (socket) { req.onSocket(socket); } else { - const err = new Error( - `no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\`` - ); + const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); onerror(err); } } - if (!this._promisifiedCallback && this.callback.length >= 3) { - // Legacy callback function - convert to a Promise + if (this.callback.length >= 3) { + // legacy callback function, convert to Promise this.callback = promisify(this.callback, this); - this._promisifiedCallback = true; } if (timeoutMs > 0) { @@ -153,8 +149,10 @@ Agent.prototype.addRequest = function addRequest(req, _opts) { } try { - Promise.resolve(this.callback(req, opts)).then(onsocket, callbackError); + Promise.resolve(this.callback(req, opts)) + .then(onsocket, callbackError); } catch (err) { - Promise.reject(err).catch(callbackError); + Promise.reject(err) + .catch(callbackError); } }; diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/package.json b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/package.json index ba9ab4e37..a41934c97 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/package.json +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/package.json @@ -1,32 +1,27 @@ { - "_args": [ - [ - "agent-base@4.2.0", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_from": "agent-base@4.2.0", - "_id": "agent-base@4.2.0", + "_from": "agent-base@~4.1.0", + "_id": "agent-base@4.1.2", "_inBundle": false, - "_integrity": "sha512-c+R/U5X+2zz2+UCrCFv6odQzJdoqI+YecuhnAJLa1zYaMc13zPfwMwZrr91Pd1DYNo/yPRbiM4WVf9whgwFsIg==", + "_integrity": "sha512-VE6QoEdaugY86BohRtfGmTDabxdU5sCKOkbcPA6PXKJsRzEi/7A3RCTxJal1ft/4qSfPht5/iQLhMh/wzSkkNw==", "_location": "/libnpmhook/npm-registry-fetch/make-fetch-happen/socks-proxy-agent/agent-base", "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "range", "registry": true, - "raw": "agent-base@4.2.0", + "raw": "agent-base@~4.1.0", "name": "agent-base", "escapedName": "agent-base", - "rawSpec": "4.2.0", + "rawSpec": "~4.1.0", "saveSpec": null, - "fetchSpec": "4.2.0" + "fetchSpec": "~4.1.0" }, "_requiredBy": [ "/libnpmhook/npm-registry-fetch/make-fetch-happen/socks-proxy-agent" ], - "_resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.0.tgz", - "_spec": "4.2.0", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.1.2.tgz", + "_shasum": "80fa6cde440f4dcf9af2617cf246099b5d99f0c8", + "_spec": "agent-base@~4.1.0", + "_where": "/Users/rebecca/code/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent", "author": { "name": "Nathan Rajlich", "email": "nathan@tootallnate.net", @@ -35,9 +30,11 @@ "bugs": { "url": "https://github.com/TooTallNate/node-agent-base/issues" }, + "bundleDependencies": false, "dependencies": { "es6-promisify": "^5.0.0" }, + "deprecated": false, "description": "Turn a function into an `http.Agent` instance", "devDependencies": { "mocha": "^3.4.2", @@ -64,5 +61,5 @@ "scripts": { "test": "mocha --reporter spec" }, - "version": "4.2.0" + "version": "4.1.2" } diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/patch-core.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/patch-core.js index 47d26a72b..3891c13a8 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/patch-core.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/patch-core.js @@ -1,4 +1,5 @@ 'use strict'; + const url = require('url'); const https = require('https'); diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js index da2e91983..23814e2c3 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js @@ -14,10 +14,6 @@ var events = require('events'); var inherits = require('util').inherits; var Agent = require('../'); -var PassthroughAgent = Agent(function(req, opts) { - return opts.secureEndpoint ? https.globalAgent : http.globalAgent; -}); - describe('Agent', function() { describe('subclass', function() { it('should be subclassable', function(done) { @@ -74,10 +70,10 @@ describe('Agent', function() { it('should be the Agent instance', function(done) { var called = false; var agent = new Agent(); - agent.callback = function() { + agent.callback = function () { called = true; assert.equal(this, agent); - }; + } var info = url.parse('http://127.0.0.1/foo'); info.agent = agent; var req = http.get(info); @@ -85,15 +81,15 @@ describe('Agent', function() { assert(/no Duplex stream was returned/.test(err.message)); done(); }); - }); + }) it('should be the Agent instance with callback signature', function(done) { var called = false; var agent = new Agent(); - agent.callback = function(req, opts, fn) { + agent.callback = function (req, opts, fn) { called = true; assert.equal(this, agent); fn(); - }; + } var info = url.parse('http://127.0.0.1/foo'); info.agent = agent; var req = http.get(info); @@ -101,8 +97,8 @@ describe('Agent', function() { assert(/no Duplex stream was returned/.test(err.message)); done(); }); - }); - }); + }) + }) describe('"error" event', function() { it('should be invoked on `http.ClientRequest` instance if `callback()` has not been defined', function( done @@ -205,7 +201,13 @@ describe('Agent', function() { 'Set-Cookie: 1\r\n' + 'Set-Cookie: 2\r\n\r\n' ); - stream.emit('data', buf); + if ('function' == typeof stream.ondata) { + // node <= v0.11.3 + stream.ondata(buf, 0, buf.length); + } else { + // node > v0.11.3 + stream.emit('data', buf); + } }); req.end(); @@ -397,28 +399,6 @@ describe('"http" module', function() { done(); }); }); - - describe('PassthroughAgent', function() { - it('should pass through to `http.globalAgent`', function(done) { - // 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 = PassthroughAgent; - http.get(info, function(res) { - assert.equal('bar', res.headers['x-foo']); - assert.equal('/foo', res.headers['x-url']); - assert(gotReq); - done(); - }); - }); - }); }); describe('"https" module', function() { @@ -446,6 +426,7 @@ describe('"https" module', function() { server.close(); }); + it('should not modify the passed in Options object', function(done) { var called = false; var agent = new Agent(function(req, opts, fn) { @@ -534,29 +515,6 @@ describe('"https" module', function() { rejectUnauthorized: false }); }); - - describe('PassthroughAgent', function() { - it('should pass through to `https.globalAgent`', function(done) { - // 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('https://127.0.0.1:' + port + '/foo'); - info.agent = PassthroughAgent; - info.rejectUnauthorized = false; - https.get(info, function(res) { - assert.equal('bar', res.headers['x-foo']); - assert.equal('/foo', res.headers['x-url']); - assert(gotReq); - done(); - }); - }); - }); }); describe('"ws" server', function() { diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.npmignore b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.npmignore deleted file mode 100644 index 7deddced8..000000000 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -.git* -.idea -npm-debug.log
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.prettierrc.yaml b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.prettierrc.yaml new file mode 100644 index 000000000..a977335a8 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.prettierrc.yaml @@ -0,0 +1,5 @@ +parser: typescript +printWidth: 80 +tabWidth: 2 +singleQuote: true +trailingComma: none diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.travis.yml b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.travis.yml new file mode 100644 index 000000000..9366dacc4 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.travis.yml @@ -0,0 +1,10 @@ +language: node_js +node_js: + - 6 + - 8 + - stable + +before_install: + - yarn global add typescript prettier tslint coveralls + +script: "yarn run build && yarn run coveralls"
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/README.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/README.md index 890b7deb6..e45e9a277 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/README.md +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/README.md @@ -1,339 +1,668 @@ -socks -============= +# socks [![Build Status](https://travis-ci.org/JoshGlazebrook/socks.svg?branch=master)](https://travis-ci.org/JoshGlazebrook/socks) [![Coverage Status](https://coveralls.io/repos/github/JoshGlazebrook/socks/badge.svg?branch=master)](https://coveralls.io/github/JoshGlazebrook/socks?branch=v2) -socks is a full client implementation of the SOCKS 4, 4a, and 5 protocols in an easy to use node.js module. +Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality. -### Notice -As of February 26th, 2015, socks is the new home of the socks-client package. +### Features -### Why socks? +* Supports SOCKS v4, v4a, and v5 protocols. +* Supports the CONNECT, BIND, and ASSOCIATE commands. +* Supports callbacks, promises, and events for proxy connection creation async flow control. +* Supports proxy chaining (CONNECT only). +* Supports user/pass authentication. +* Built in UDP frame creation & parse functions. +* Created with TypeScript, type definitions are provided. -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. +### Requirements -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) +* Node.js v6.0+ (Please use [v1](https://github.com/JoshGlazebrook/socks/tree/82d83923ad960693d8b774cafe17443ded7ed584) for older versions of Node.js) -## Installing: +### Looking for v1? +* Docs for v1 are available [here](https://github.com/JoshGlazebrook/socks/tree/82d83923ad960693d8b774cafe17443ded7ed584) -`npm install socks` +## Installation -### Getting Started Example +`yarn add socks` -For this example, say you wanted to grab the html of google's home page. +or -```javascript -var Socks = require('socks'); +`npm install --save 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. -}; +## Usage -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... - } -}); +```typescript +// TypeScript +import { SocksClient, SocksClientOptions, SocksClientChainOptions } from 'socks'; + +// ES6 JavaScript +import { SocksClient } from 'socks'; + +// Legacy JavaScript +const SocksClient = require('socks').SocksClient; ``` -### BIND Example: +## Quick Start 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. +Connect to github.com (192.30.253.113) on port 80, using a SOCKS proxy. ```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 - } +const options = { + proxy: { + ipaddress: '159.203.75.200', + port: 1080, + type: 5 // Proxy version (4 or 5) + }, + + command: 'connect', // SOCKS command (createConnection factory function only supports the connect command) + + destination: { + host: '192.30.253.113', // github.com (hostname lookups are supported with SOCKS v4a and 5) + port: 80 + } }; -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); +// Async/Await +try { + const info = await SocksClient.createConnection(options); - // { port: 1494, host: '202.101.228.108' } - - socket.on('data', function(data) { - console.log(data.length); - console.log(data); - }); + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy server) +} catch (err) { + // Handle errors +} - // Remember to resume the socket stream. - socket.resume(); - } +// Promises +SocksClient.createConnection(options) +.then(info => { + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy server) +}) +.catch(err => { + // Handle errors }); +// Callbacks +SocksClient.createConnection(options, (err, info) => { + if (!err) { + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy server) + } else { + // Handle errors + } +}); ``` -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: +## Chaining Proxies -``` -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:** Chaining is only supported when using the SOCKS connect command, and chaining can only be done through the special factory chaining function. -Note that this connection to the newly bound port does not need to go through the SOCKS handshake. +This example makes a proxy chain through two SOCKS proxies to ip-api.com. Once the connection to the destination is established it sends an HTTP request to get a JSON response that returns ip info for the requesting ip. -Back at our original connection we see that we have received some new data: +```javascript +const options = { + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + command: 'connect', // Only the connect command is supported when chaining proxies. + proxies: [ // The chain order is the order in the proxies array, meaning the last proxy will establish a connection to the destination. + { + ipaddress: '159.203.75.235', + port: 1081, + type: 5 + }, + { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + } + ] +} -``` -8 -<Buffer 00 5a ca 61 43 a8 09 01> // This first piece of information can be ignored. +// Async/Await +try { + const info = await SocksClient.createConnectionChain(options); + + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + console.log(info.socket.remoteAddress) // The remote address of the returned socket is the first proxy in the chain. + // 159.203.75.235 + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy in the chain (104.131.124.203) is connected to it. + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + }); +} catch (err) { + // Handle errors +} -7 -<Buffer 68 65 6c 6c 6f 0d 0a> // Hello <\r\n (enter key)> +// Promises +SocksClient.createConnectionChain(options) +.then(info => { + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy server) + + console.log(info.socket.remoteAddress) // The remote address of the returned socket is the first proxy in the chain. + // 159.203.75.235 + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy in the chain (104.131.124.203) is connected to it. + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + }); +}) +.catch(err => { + // Handle errors +}); -11 -<Buffer 61 61 61 61 61 61 61 61 61 0d 0a> // aaaaaaaaa <\r\n (enter key)> +// Callbacks +SocksClient.createConnectionChain(options, (err, info) => { + if (!err) { + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy server) + + console.log(info.socket.remoteAddress) // The remote address of the returned socket is the first proxy in the chain. + // 159.203.75.235 + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy in the chain (104.131.124.203) is connected to it. + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + }); + } else { + // Handle errors + } +}); ``` -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. +## Bind Example (TCP Relay) -**Note** Please pay close attention to the first piece of data that was received. +When the bind command is sent to a SOCKS v4/v5 proxy server, the proxy server starts listening on a new TCP port and the proxy relays then remote host information back to the client. When another remote client connects to the proxy server on this port the SOCKS proxy sends a notification that an incoming connection has been accepted to the initial client and a full duplex stream is now established to the initial client and the client that connected to that special port. -``` -<Buffer 00 5a ca 61 43 a8 09 01> +```javascript +const options = { + proxy: { + ipaddress: '159.203.75.235', + port: 1081, + type: 5 + }, + + command: 'bind', + + // When using BIND, the destination should be the remote client that is expected to connect to the SOCKS proxy. Using 0.0.0.0 makes the Proxy accept any incoming connection on that port. + destination: { + host: '0.0.0.0', + port: 0 + } +}; - [005a] [PORT:2} [IP:4] -``` +// Creates a new SocksClient instance. +const client = new SocksClient(options); + +// When the SOCKS proxy has bound a new port and started listening, this event is fired. +client.on('bound', info => { + console.log(info.remoteHost); + /* + { + host: "159.203.75.235", + port: 57362 + } + */ +}); -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. +// When a client connects to the newly bound port on the SOCKS proxy, this event is fired. +client.on('established', info => { + // info.remoteHost is the remote address of the client that connected to the SOCKS proxy. + console.log(info.remoteHost); + /* + host: 67.171.34.23, + port: 49823 + */ + + console.log(info.socket); + // <Socket ...> (This is a raw net.Socket that is a connection between the initial client and the remote client that connected to the proxy) + + // Handle received data... + info.socket.on('data', data => { + console.log('recv', data); + }); +}); -### 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. +// An error occurred trying to establish this SOCKS connection. +client.on('error', err => { + console.error(err); +}); -```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 - } -}; +// Start connection to proxy +client.connect(); +``` +## Associate Example (UDP Relay) -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' } +When the associate command is sent to a SOCKS v5 proxy server, it sets up a UDP relay that allows the client to send UDP packets to a remote host through the proxy server, and also receive UDP packet responses back through the proxy server. - var udp = new dgram.Socket('udp4'); +```javascript +const options = { + proxy: { + ipaddress: '159.203.75.235', + port: 1081, + type: 5 + }, + + command: 'associate', + + // When using associate, the destination should be the remote client that is expected to send UDP packets to the proxy server to be forwarded. This should be your local ip, or optionally the wildcard address (0.0.0.0) UDP Client <-> Proxy <-> UDP Client + destination: { + host: '0.0.0.0', + port: 0 + } +}; - // In this example we are going to send "Hello" to 1.2.3.4:2323 through the SOCKS proxy. +// Create a local UDP socket for sending packets to the proxy. +const udpSocket = dgram.createSocket('udp4'); +udpSocket.bind(); + +// Listen for incoming UDP packets from the proxy server. +udpSocket.on('message', (message, rinfo) => { + console.log(SocksClient.parseUDPFrame(message)); + /* + { frameNumber: 0, + remoteHost: { host: '165.227.108.231', port: 4444 }, // The remote host that replied with a UDP packet + data: <Buffer 74 65 73 74 0a> // The data + } + */ +}); - var pack = Socks.createUDPFrame({ host: "1.2.3.4", port: 2323}, new Buffer("hello")); +let client = new SocksClient(associateOptions); - // Send Packet to Proxy UDP endpoint given in the info object. - udp.send(pack, 0, pack.length, info.port, info.host); +// When the UDP relay is established, this event is fired and includes the UDP relay port to send data to on the proxy server. +client.on('established', info => { + console.log(info.remoteHost); + /* + { + host: '159.203.75.235', + port: 44711 } + */ + + // Send 'hello' to 165.227.108.231:4444 + const packet = SocksClient.createUDPFrame({ + remoteHost: { host: '165.227.108.231', port: 4444 }, + data: Buffer.from(line) + }); + udpSocket.send(packet, info.remoteHost.port, info.remoteHost.host); }); +// Start connection +client.connect(); ``` -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. +**Note:** The associate TCP connection to the proxy must remain open for the UDP relay to work. -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> -``` +## Additional Examples -## Using socks as an HTTP Agent +[Documentation](docs/index.md) -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. +## Migrating from v1 -The second argument is a boolean which indicates whether the remote endpoint requires TLS. +Looking for a guide to migrate from v1? Look [here](docs/migratingFromV1.md) -```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: -# Api Reference: +**Note:** socks includes full TypeScript definitions. These can even be used without using TypeScript as most IDEs (such as VS Code) will use these type definition files for auto completion intellisense even in JavaScript files. -There are only three exported functions that you will ever need to use. +* Class: SocksClient + * [new SocksClient(options[, callback])](#new-socksclientoptions) + * [Class Method: SocksClient.createConnection(options[, callback])](#class-method-socksclientcreateconnectionoptions-callback) + * [Class Method: SocksClient.createConnectionChain(options[, callback])](#class-method-socksclientcreateconnectionchainoptions-callback) + * [Class Method: SocksClient.createUDPFrame(options)](#class-method-socksclientcreateudpframedetails) + * [Class Method: SocksClient.parseUDPFrame(data)](#class-method-socksclientparseudpframedata) + * [Event: 'error'](#event-error) + * [Event: 'bound'](#event-bound) + * [Event: 'established'](#event-established) + * [client.connect()](#clientconnect) + * [client.socksClientOptions](#clientconnect) -### Socks.createConnection( options, callback(err, socket, info) ) -> `Object` **Object containing options to use when creating this connection** +### SocksClient -> `function` **Callback that is called when connection completes or errors** +SocksClient establishes SOCKS proxy connections to remote destination hosts. These proxy connections are fully transparent to the server and once established act as full duplex streams. SOCKS v4, v4a, and v5 are supported, as well as the connect, bind, and associate commands. -Options: +SocksClient supports creating connections using callbacks, promises, and async/await flow control using two static factory functions createConnection and createConnectionChain. It also internally extends EventEmitter which results in allowing event handling based async flow control. -```javascript -var options = { +**SOCKS Compatibility Table** - // Information about proxy server - proxy: { - // IP Address of Proxy (Required) - ipaddress: "1.2.3.4", +| Socks Version | TCP | UDP | IPv4 | IPv6 | Hostname | +| --- | :---: | :---: | :---: | :---: | :---: | +| SOCKS v4 | ✅ | ❌ | ✅ | ❌ | ❌ | +| SOCKS v4a | ✅ | ❌ | ✅ | ❌ | ✅ | +| SOCKS v5 | ✅ | ✅ | ✅ | ✅ | ✅ | - // TCP Port of Proxy (Required) - port: 1080, +### new SocksClient(options) - // Proxy Type [4, 5] (Required) - // Note: 4 works for both 4 and 4a. - type: 4, +* ```options``` {SocksClientOptions} - An object describing the SOCKS proxy to use, the command to send and establish, and the destination host to connect to. - // SOCKS Connection Type (Optional) - // - defaults to 'connect' +### SocksClientOptions - // '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", +```typescript +{ + proxy: { + ipaddress: '159.203.75.200', // ipv4 or ipv6 + port: 1080, + type: 5 // Proxy version (4 or 5). For v4a, just use 4. + // Optional fields + userId: 'some username', // Used for SOCKS4 userId auth, and SOCKS5 user/pass auth in conjunction with password. + password: 'some password' // Used in conjunction with userId for user/pass auth for SOCKS5 proxies. + }, - // SOCKS 4 Specific: + command: 'connect', // connect, bind, associate - // UserId used when making a SOCKS 4/4a request. (Optional) - userid: "someuserid", + destination: { + host: '192.30.253.113', // ipv4, ipv6, hostname. Hostnames work with v4a and v5. + port: 80 + }, - // SOCKS 5 Specific: + // Optional fields + timeout: 30000; // How long to wait to establish a proxy connection. (defaults to 30 seconds) +} +``` - // Authentication used for SOCKS 5 (when it's required) (Optional) - authentication: { - username: "Josh", - password: "somepassword" - } - }, +### Class Method: SocksClient.createConnection(options[, callback]) +* ```options``` { SocksClientOptions } - An object describing the SOCKS proxy to use, the command to send and establish, and the destination host to connect to. +* ```callback``` { Function } - Optional callback function that is called when the proxy connection is established, or an error occurs. +* ```returns``` { Promise } - A Promise is returned that is resolved when the proxy connection is established, or rejected when an error occurs. + +Creates a new proxy connection through the given proxy to the given destination host. This factory function supports callbacks and promises for async flow control. + +**Note:** If a callback function is provided, the promise will always resolve regardless of an error occurring. Please be sure to exclusively use either promises or callbacks when using this factory function. + +```typescript +const options = { + proxy: { + ipaddress: '159.203.75.200', // ipv4 or ipv6 + port: 1080, + type: 5 // Proxy version (4 or 5) + }, + + command: 'connect', // connect, bind, associate + + destination: { + host: '192.30.253.113', // ipv4, ipv6, hostname + port: 80 + } +} + +// Await/Async (uses a Promise) +try { + const info = await SocksClient.createConnection(options); + console.log(info); + /* + { + socket: <Socket ...>, // Raw net.Socket + } + */ + / <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy server) + +} catch (err) { + // Handle error... +} + +// Promise +SocksClient.createConnection(options) +.then(info => { + console.log(info); + /* + { + socket: <Socket ...>, // Raw net.Socket + } + */ +}) +.catch(err => { + // Handle error... +}); - // 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. +// Callback +SocksClient.createConnection(options, (err, info) => { + if (!err) { + console.log(info); + /* + { + socket: <Socket ...>, // Raw net.Socket + } + */ + } else { + // Handle error... + } +}); +``` + +### Class Method: SocksClient.createConnectionChain(options[, callback]) +* ```options``` { SocksClientChainOptions } - An object describing a list of SOCKS proxies to use, the command to send and establish, and the destination host to connect to. +* ```callback``` { Function } - Optional callback function that is called when the proxy connection chain is established, or an error occurs. +* ```returns``` { Promise } - A Promise is returned that is resolved when the proxy connection chain is established, or rejected when an error occurs. - // 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", +Creates a new proxy connection chain through a list of at least two SOCKS proxies to the given destination host. This factory method supports callbacks and promises for async flow control. - // TCP port of target to connect to. - port: 1080 +**Note:** If a callback function is provided, the promise will always resolve regardless of an error occurring. Please be sure to exclusively use either promises or callbacks when using this factory function. + +**Note:** At least two proxies must be provided for the chain to be established. + +```typescript +const options = { + proxies: [ // The chain order is the order in the proxies array, meaning the last proxy will establish a connection to the destination. + { + ipaddress: '159.203.75.235', // ipv4 or ipv6 + port: 1081, + type: 5 }, + { + ipaddress: '104.131.124.203', // ipv4 or ipv6 + port: 1081, + type: 5 + } + ] - // Amount of time to wait for a connection to be established. (Optional) - // - defaults to 10000ms (10 seconds) - timeout: 10000 -}; + command: 'connect', // Only connect is supported in chaining mode. + + destination: { + host: '192.30.253.113', // ipv4, ipv6, hostname + port: 80 + } +} ``` -Callback: -```javascript +### Class Method: SocksClient.createUDPFrame(details) +* ```details``` { SocksUDPFrameDetails } - An object containing the remote host, frame number, and frame data to use when creating a SOCKS UDP frame packet. +* ```returns``` { Buffer } - A Buffer containing all of the UDP frame data. -// 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. +Creates a SOCKS UDP frame relay packet that is sent and received via a SOCKS proxy when using the associate command for UDP packet forwarding. -function(err, socket, info) { - // Hopefully no errors :-) +**SocksUDPFrameDetails** + +```typescript +{ + frameNumber: 0, // The frame number (used for breaking up larger packets) + + remoteHost: { // The remote host to have the proxy send data to, or the remote host that send this data. + host: '1.2.3.4', + port: 1234 + }, + + data: <Buffer 01 02 03 04...> // A Buffer instance of data to include in the packet (actual data sent to the remote host) +} +interface SocksUDPFrameDetails { + // The frame number of the packet. + frameNumber?: number; + + // The remote host. + remoteHost: SocksRemoteHost; + + // The packet data. + data: Buffer; } ``` -### Socks.createUDPFrame( target, data, [frame] ) -> `Object` **Target host object containing destination for UDP packet** +### Class Method: SocksClient.parseUDPFrame(data) +* ```data``` { Buffer } - A Buffer instance containing SOCKS UDP frame data to parse. +* ```returns``` { SocksUDPFrameDetails } - An object containing the remote host, frame number, and frame data of the SOCKS UDP frame. + +```typescript +const frame = SocksClient.parseUDPFrame(data); +console.log(frame); +/* +{ + frameNumber: 0, + remoteHost: { + host: '1.2.3.4', + port: 1234 + }, + data: <Buffer 01 02 03 04 ...> +} +*/ +``` -> `Buffer` **Data Buffer to send in the UDP packet** +Parses a Buffer instance and returns the parsed SocksUDPFrameDetails object. -> `Number` **Frame number in UDP packet. (defaults to 0)** +## Event: 'error' +* ```err``` { SocksClientError } - An Error object containing an error message and the original SocksClientOptions. -Creates a UDP packet frame for using with UDP association relays. +This event is emitted if an error occurs when trying to establish the proxy connection. -returns `Buffer` The completed UDP packet container to be sent to the proxy for forwarding. +## Event: 'bound' +* ```info``` { SocksClientBoundEvent } An object containing a Socket and SocksRemoteHost info. -target: -```javascript +This event is emitted when using the BIND command on a remote SOCKS proxy server. This event indicates the proxy server is now listening for incoming connections on a specified port. -// 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", +**SocksClientBoundEvent** +```typescript +{ + socket: net.Socket, // The underlying raw Socket + remoteHost: { + host: '1.2.3.4', // The remote host that is listening (usually the proxy itself) + port: 4444 // The remote port the proxy is listening on for incoming connections (when using BIND). + } +} +``` - // udpport for where to send the UDP packet. - port: 2323 - } +## Event: 'established' +* ```info``` { SocksClientEstablishedEvent } An object containing a Socket and SocksRemoteHost info. + +This event is emitted when the following conditions are met: +1. When using the CONNECT command, and a proxy connection has been established to the remote host. +2. When using the BIND command, and an incoming connection has been accepted by the proxy and a TCP relay has been established. +3. When using the ASSOCIATE command, and a UDP relay has been established. + +When using BIND, 'bound' is first emitted to indicate the SOCKS server is waiting for an incoming connection, and provides the remote port the SOCKS server is listening on. +When using ASSOCIATE, 'established' is emitted with the remote UDP port the SOCKS server is accepting UDP frame packets on. + +**SocksClientEstablishedEvent** +```typescript +{ + socket: net.Socket, // The underlying raw Socket + remoteHost: { + host: '1.2.3.4', // The remote host that is listening (usually the proxy itself) + port: 52738 // The remote port the proxy is listening on for incoming connections (when using BIND). + } +} ``` -### Socks.Agent( options, tls) ) -> `Object` **Object containing options to use when creating this connection (see above in createConnection)** +## client.connect() + +Starts connecting to the remote SOCKS proxy server to establish a proxy connection to the destination host. -> `boolean` **Boolean indicating if we upgrade the connection to TLS on the socks server** +## client.socksClientOptions +* ```returns``` { SocksClientOptions } The options that were passed to the SocksClient. +Gets the options that were passed to the SocksClient when it was created. + + +**SocksClientError** +```typescript +{ // Subclassed from Error. + message: 'An error has occurred', + options: { + // SocksClientOptions + } +} +``` # 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/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/client/socksclient.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/client/socksclient.js new file mode 100644 index 000000000..9968eb9a3 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/client/socksclient.js @@ -0,0 +1,704 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const events_1 = require("events"); +const net = require("net"); +const ip = require("ip"); +const smart_buffer_1 = require("smart-buffer"); +const constants_1 = require("../common/constants"); +const helpers_1 = require("../common/helpers"); +const receivebuffer_1 = require("../common/receivebuffer"); +const util_1 = require("../common/util"); +class SocksClient extends events_1.EventEmitter { + constructor(options) { + super(); + this._options = Object.assign({}, options); + // Validate SocksClientOptions + helpers_1.validateSocksClientOptions(options); + // Default state + this.state = constants_1.SocksClientState.Created; + } + /** + * Creates a new SOCKS connection. + * + * Note: Supports callbacks and promises. Only supports the connect command. + * @param options { SocksClientOptions } Options. + * @param callback { Function } An optional callback function. + * @returns { Promise } + */ + static createConnection(options, callback) { + // Validate SocksClientOptions + helpers_1.validateSocksClientOptions(options, ['connect']); + return new Promise((resolve, reject) => { + const client = new SocksClient(options); + client.connect(options.existing_socket); + client.once('established', (info) => { + client.removeAllListeners(); + if (typeof callback === 'function') { + callback(null, info); + resolve(); // Resolves pending promise (prevents memory leaks). + } + else { + resolve(info); + } + }); + // Error occurred, failed to establish connection. + client.once('error', (err) => { + client.removeAllListeners(); + if (typeof callback === 'function') { + callback(err); + resolve(); // Resolves pending promise (prevents memory leaks). + } + else { + reject(err); + } + }); + }); + } + /** + * Creates a new SOCKS connection chain to a destination host through 2 or more SOCKS proxies. + * + * Note: Supports callbacks and promises. Only supports the connect method. + * Note: Implemented via createConnection() factory function. + * @param options { SocksClientChainOptions } Options + * @param callback { Function } An optional callback function. + * @returns { Promise } + */ + static createConnectionChain(options, callback) { + // Validate SocksClientChainOptions + helpers_1.validateSocksClientChainOptions(options); + // Shuffle proxies + if (options.randomizeChain) { + util_1.shuffleArray(options.proxies); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let sock; + try { + for (let i = 0; i < options.proxies.length; i++) { + const nextProxy = options.proxies[i]; + // If we've reached the last proxy in the chain, the destination is the actual destination, otherwise it's the next proxy. + const nextDestination = i === options.proxies.length - 1 + ? options.destination + : { + host: options.proxies[i + 1].ipaddress, + port: options.proxies[i + 1].port + }; + // Creates the next connection in the chain. + const result = yield SocksClient.createConnection({ + command: 'connect', + proxy: nextProxy, + destination: nextDestination + // Initial connection ignores this as sock is undefined. Subsequent connections re-use the first proxy socket to form a chain. + }); + // If sock is undefined, assign it here. + if (!sock) { + sock = result.socket; + } + } + if (typeof callback === 'function') { + callback(null, { socket: sock }); + resolve(); // Resolves pending promise (prevents memory leaks). + } + else { + resolve({ socket: sock }); + } + } + catch (err) { + if (typeof callback === 'function') { + callback(err); + resolve(); // Resolves pending promise (prevents memory leaks). + } + else { + reject(err); + } + } + })); + } + /** + * Creates a SOCKS UDP Frame. + * @param options + */ + static createUDPFrame(options) { + const buff = new smart_buffer_1.SmartBuffer(); + buff.writeUInt16BE(0); + buff.writeUInt8(options.frameNumber || 0); + // IPv4/IPv6/Hostname + if (net.isIPv4(options.remoteHost.host)) { + buff.writeUInt8(constants_1.Socks5HostType.IPv4); + buff.writeUInt32BE(ip.toLong(options.remoteHost.host)); + } + else if (net.isIPv6(options.remoteHost.host)) { + buff.writeUInt8(constants_1.Socks5HostType.IPv6); + buff.writeBuffer(ip.toBuffer(options.remoteHost.host)); + } + else { + buff.writeUInt8(constants_1.Socks5HostType.Hostname); + buff.writeUInt8(Buffer.byteLength(options.remoteHost.host)); + buff.writeString(options.remoteHost.host); + } + // Port + buff.writeUInt16BE(options.remoteHost.port); + // Data + buff.writeBuffer(options.data); + return buff.toBuffer(); + } + /** + * Parses a SOCKS UDP frame. + * @param data + */ + static parseUDPFrame(data) { + const buff = smart_buffer_1.SmartBuffer.fromBuffer(data); + buff.readOffset = 2; + const frameNumber = buff.readUInt8(); + const hostType = buff.readUInt8(); + let remoteHost; + if (hostType === constants_1.Socks5HostType.IPv4) { + remoteHost = ip.fromLong(buff.readUInt32BE()); + } + else if (hostType === constants_1.Socks5HostType.IPv6) { + remoteHost = ip.toString(buff.readBuffer(16)); + } + else { + remoteHost = buff.readString(buff.readUInt8()); + } + const remotePort = buff.readUInt16BE(); + return { + frameNumber, + remoteHost: { + host: remoteHost, + port: remotePort + }, + data: buff.readBuffer() + }; + } + /** + * Gets the SocksClient internal state. + */ + get state() { + return this._state; + } + /** + * Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state. + */ + set state(newState) { + if (this._state !== constants_1.SocksClientState.Error) { + this._state = newState; + } + } + /** + * Starts the connection establishment to the proxy and destination. + * @param existing_socket Connected socket to use instead of creating a new one (internal use). + */ + connect(existing_socket) { + this._onDataReceived = (data) => this.onDataReceived(data); + this._onClose = () => this.onClose(); + this._onError = (err) => this.onError(err); + this._onConnect = () => this.onConnect(); + // Start timeout timer (defaults to 30 seconds) + setTimeout(() => this.onEstablishedTimeout(), this._options.timeout || constants_1.DEFAULT_TIMEOUT); + // If an existing socket is provided, use it to negotiate SOCKS handshake. Otherwise create a new Socket. + if (existing_socket) { + this._socket = existing_socket; + } + else { + this._socket = new net.Socket(); + } + // Attach Socket error handlers. + this._socket.once('close', this._onClose); + this._socket.once('error', this._onError); + this._socket.once('connect', this._onConnect); + this._socket.on('data', this._onDataReceived); + this.state = constants_1.SocksClientState.Connecting; + this._receiveBuffer = new receivebuffer_1.ReceiveBuffer(); + if (existing_socket) { + this._socket.emit('connect'); + } + else { + this._socket.connect(this._options.proxy.port, this._options.proxy.ipaddress); + } + // Listen for established event so we can re-emit any excess data received during handshakes. + this.prependOnceListener('established', info => { + setImmediate(() => { + if (this._receiveBuffer.length > 0) { + const excessData = this._receiveBuffer.get(this._receiveBuffer.length); + info.socket.emit('data', excessData); + } + info.socket.resume(); + }); + }); + } + /** + * Handles internal Socks timeout callback. + * Note: If the Socks client is not BoundWaitingForConnection or Established, the connection will be closed. + */ + onEstablishedTimeout() { + if (this.state !== constants_1.SocksClientState.Established && + this.state !== constants_1.SocksClientState.BoundWaitingForConnection) { + this._closeSocket(constants_1.ERRORS.ProxyConnectionTimedOut); + } + } + /** + * Handles Socket connect event. + */ + onConnect() { + this.state = constants_1.SocksClientState.Connected; + // Send initial handshake. + if (this._options.proxy.type === 4) { + this.sendSocks4InitialHandshake(); + } + else { + this.sendSocks5InitialHandshake(); + } + this.state = constants_1.SocksClientState.SentInitialHandshake; + } + /** + * Handles Socket data event. + * @param data + */ + onDataReceived(data) { + /* + All received data is appended to a ReceiveBuffer. + This makes sure that all the data we need is received before we attempt to process it. + */ + this._receiveBuffer.append(data); + // Process data that we have. + this.processData(); + } + /** + * Handles processing of the data we have received. + */ + processData() { + // If we have enough data to process the next step in the SOCKS handshake, proceed. + if (this._receiveBuffer.length >= this._nextRequiredPacketBufferSize) { + // Sent initial handshake, waiting for response. + if (this.state === constants_1.SocksClientState.SentInitialHandshake) { + if (this._options.proxy.type === 4) { + // Socks v4 only has one handshake response. + this.handleSocks4FinalHandshakeResponse(); + } + else { + // Socks v5 has two handshakes, handle initial one here. + this.handleInitialSocks5HandshakeResponse(); + } + // Sent auth request for Socks v5, waiting for response. + } + else if (this.state === constants_1.SocksClientState.SentAuthentication) { + this.handleInitialSocks5AuthenticationHandshakeResponse(); + // Sent final Socks v5 handshake, waiting for final response. + } + else if (this.state === constants_1.SocksClientState.SentFinalHandshake) { + this.handleSocks5FinalHandshakeResponse(); + // Socks BIND established. Waiting for remote connection via proxy. + } + else if (this.state === constants_1.SocksClientState.BoundWaitingForConnection) { + if (this._options.proxy.type === 4) { + this.handleSocks4IncomingConnectionResponse(); + } + else { + this.handleSocks5IncomingConnectionResponse(); + } + } + else if (this.state === constants_1.SocksClientState.Established) { + // do nothing (prevents closing of the socket) + } + else { + this._closeSocket(constants_1.ERRORS.InternalError); + } + } + } + /** + * Handles Socket close event. + * @param had_error + */ + onClose() { + this._closeSocket(constants_1.ERRORS.SocketClosed); + } + /** + * Handles Socket error event. + * @param err + */ + onError(err) { + this._closeSocket(err.message); + } + /** + * Removes internal event listeners on the underlying Socket. + */ + removeInternalSocketHandlers() { + // Pauses data flow of the socket (this is internally resumed after 'established' is emitted) + this._socket.pause(); + this._socket.removeListener('data', this._onDataReceived); + this._socket.removeListener('close', this._onClose); + this._socket.removeListener('error', this._onError); + this._socket.removeListener('connect', this.onConnect); + } + /** + * Closes and destroys the underlying Socket. Emits an error event. + * @param err { String } An error string to include in error event. + */ + _closeSocket(err) { + // Make sure only one 'error' event is fired for the lifetime of this SocksClient instance. + if (this.state !== constants_1.SocksClientState.Error) { + // Set internal state to Error. + this.state = constants_1.SocksClientState.Error; + // Destroy Socket + if (!this._socket.destroyed) { + this._socket.destroy(); + } + // Remove internal listeners + this.removeInternalSocketHandlers(); + // Fire 'error' event. + this.emit('error', new util_1.SocksClientError(err, this._options)); + } + } + /** + * Sends initial Socks v4 handshake request. + */ + sendSocks4InitialHandshake() { + const userId = this._options.proxy.userId || ''; + const buff = new smart_buffer_1.SmartBuffer(); + buff.writeUInt8(0x04); + buff.writeUInt8(constants_1.SocksCommand[this._options.command]); + buff.writeUInt16BE(this._options.destination.port); + // Socks 4 (IPv4) + if (net.isIPv4(this._options.destination.host)) { + buff.writeBuffer(ip.toBuffer(this._options.destination.host)); + buff.writeStringNT(userId); + // Socks 4a (hostname) + } + else { + buff.writeUInt8(0x00); + buff.writeUInt8(0x00); + buff.writeUInt8(0x00); + buff.writeUInt8(0x01); + buff.writeStringNT(userId); + buff.writeStringNT(this._options.destination.host); + } + this._nextRequiredPacketBufferSize = + constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks4Response; + this._socket.write(buff.toBuffer()); + } + /** + * Handles Socks v4 handshake response. + * @param data + */ + handleSocks4FinalHandshakeResponse() { + const data = this._receiveBuffer.get(8); + if (data[1] !== constants_1.Socks4Response.Granted) { + this._closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedConnection} - (${constants_1.Socks4Response[data[1]]})`); + } + else { + // Bind response + if (constants_1.SocksCommand[this._options.command] === constants_1.SocksCommand.bind) { + const buff = smart_buffer_1.SmartBuffer.fromBuffer(data); + buff.readOffset = 2; + const remoteHost = { + port: buff.readUInt16BE(), + host: ip.fromLong(buff.readUInt32BE()) + }; + // If host is 0.0.0.0, set to proxy host. + if (remoteHost.host === '0.0.0.0') { + remoteHost.host = this._options.proxy.ipaddress; + } + this.state = constants_1.SocksClientState.BoundWaitingForConnection; + this.emit('bound', { socket: this._socket, remoteHost }); + // Connect response + } + else { + this.state = constants_1.SocksClientState.Established; + this.removeInternalSocketHandlers(); + this.emit('established', { socket: this._socket }); + } + } + } + /** + * Handles Socks v4 incoming connection request (BIND) + * @param data + */ + handleSocks4IncomingConnectionResponse() { + const data = this._receiveBuffer.get(8); + if (data[1] !== constants_1.Socks4Response.Granted) { + this._closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${constants_1.Socks4Response[data[1]]})`); + } + else { + const buff = smart_buffer_1.SmartBuffer.fromBuffer(data); + buff.readOffset = 2; + const remoteHost = { + port: buff.readUInt16BE(), + host: ip.fromLong(buff.readUInt32BE()) + }; + this.state = constants_1.SocksClientState.Established; + this.removeInternalSocketHandlers(); + this.emit('established', { socket: this._socket, remoteHost }); + } + } + /** + * Sends initial Socks v5 handshake request. + */ + sendSocks5InitialHandshake() { + const buff = new smart_buffer_1.SmartBuffer(); + buff.writeUInt8(0x05); + buff.writeUInt8(2); + buff.writeUInt8(constants_1.Socks5Auth.NoAuth); + buff.writeUInt8(constants_1.Socks5Auth.UserPass); + this._nextRequiredPacketBufferSize = + constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse; + this._socket.write(buff.toBuffer()); + this.state = constants_1.SocksClientState.SentInitialHandshake; + } + /** + * Handles initial Socks v5 handshake response. + * @param data + */ + handleInitialSocks5HandshakeResponse() { + const data = this._receiveBuffer.get(2); + if (data[0] !== 0x05) { + this._closeSocket(constants_1.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion); + } + else if (data[1] === 0xff) { + this._closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType); + } + else { + // If selected Socks v5 auth method is no auth, send final handshake request. + if (data[1] === constants_1.Socks5Auth.NoAuth) { + this.sendSocks5CommandRequest(); + // If selected Socks v5 auth method is user/password, send auth handshake. + } + else if (data[1] === constants_1.Socks5Auth.UserPass) { + this.sendSocks5UserPassAuthentication(); + } + else { + this._closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType); + } + } + } + /** + * Sends Socks v5 user & password auth handshake. + * + * Note: No auth and user/pass are currently supported. + */ + sendSocks5UserPassAuthentication() { + const userId = this._options.proxy.userId || ''; + const password = this._options.proxy.password || ''; + const buff = new smart_buffer_1.SmartBuffer(); + buff.writeUInt8(0x01); + buff.writeUInt8(Buffer.byteLength(userId)); + buff.writeString(userId); + buff.writeUInt8(Buffer.byteLength(password)); + buff.writeString(password); + this._nextRequiredPacketBufferSize = + constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse; + this._socket.write(buff.toBuffer()); + this.state = constants_1.SocksClientState.SentAuthentication; + } + /** + * Handles Socks v5 auth handshake response. + * @param data + */ + handleInitialSocks5AuthenticationHandshakeResponse() { + this.state = constants_1.SocksClientState.ReceivedAuthenticationResponse; + const data = this._receiveBuffer.get(2); + if (data[1] !== 0x00) { + this._closeSocket(constants_1.ERRORS.Socks5AuthenticationFailed); + } + else { + this.sendSocks5CommandRequest(); + } + } + /** + * Sends Socks v5 final handshake request. + */ + sendSocks5CommandRequest() { + const buff = new smart_buffer_1.SmartBuffer(); + buff.writeUInt8(0x05); + buff.writeUInt8(constants_1.SocksCommand[this._options.command]); + buff.writeUInt8(0x00); + // ipv4, ipv6, domain? + if (net.isIPv4(this._options.destination.host)) { + buff.writeUInt8(constants_1.Socks5HostType.IPv4); + buff.writeBuffer(ip.toBuffer(this._options.destination.host)); + } + else if (net.isIPv6(this._options.destination.host)) { + buff.writeUInt8(constants_1.Socks5HostType.IPv6); + buff.writeBuffer(ip.toBuffer(this._options.destination.host)); + } + else { + buff.writeUInt8(constants_1.Socks5HostType.Hostname); + buff.writeUInt8(this._options.destination.host.length); + buff.writeString(this._options.destination.host); + } + buff.writeUInt16BE(this._options.destination.port); + this._nextRequiredPacketBufferSize = + constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader; + this._socket.write(buff.toBuffer()); + this.state = constants_1.SocksClientState.SentFinalHandshake; + } + /** + * Handles Socks v5 final handshake response. + * @param data + */ + handleSocks5FinalHandshakeResponse() { + // Peek at available data (we need at least 5 bytes to get the hostname length) + const header = this._receiveBuffer.peek(5); + if (header[0] !== 0x05 || header[1] !== constants_1.Socks5Response.Granted) { + this._closeSocket(`${constants_1.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${constants_1.Socks5Response[header[1]]}`); + } + else { + // Read address type + const addressType = header[3]; + let remoteHost; + let buff; + // IPv4 + if (addressType === constants_1.Socks5HostType.IPv4) { + // Check if data is available. + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4; + if (this._receiveBuffer.length < dataNeeded) { + this._nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this._receiveBuffer.get(dataNeeded).slice(4)); + remoteHost = { + host: ip.fromLong(buff.readUInt32BE()), + port: buff.readUInt16BE() + }; + // If given host is 0.0.0.0, assume remote proxy ip instead. + if (remoteHost.host === '0.0.0.0') { + remoteHost.host = this._options.proxy.ipaddress; + } + // Hostname + } + else if (addressType === constants_1.Socks5HostType.Hostname) { + const hostLength = header[4]; + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength); // header + host length + host + port + // Check if data is available. + if (this._receiveBuffer.length < dataNeeded) { + this._nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this._receiveBuffer.get(dataNeeded).slice(5) // Slice at 5 to skip host length + ); + remoteHost = { + host: buff.readString(hostLength), + port: buff.readUInt16BE() + }; + // IPv6 + } + else if (addressType === constants_1.Socks5HostType.IPv6) { + // Check if data is available. + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; + if (this._receiveBuffer.length < dataNeeded) { + this._nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this._receiveBuffer.get(dataNeeded).slice(4)); + remoteHost = { + host: ip.toString(buff.readBuffer(16)), + port: buff.readUInt16BE() + }; + } + // We have everything we need + this.state = constants_1.SocksClientState.ReceivedFinalResponse; + // If using CONNECT, the client is now in the established state. + if (constants_1.SocksCommand[this._options.command] === constants_1.SocksCommand.connect) { + this.state = constants_1.SocksClientState.Established; + this.removeInternalSocketHandlers(); + this.emit('established', { socket: this._socket }); + } + else if (constants_1.SocksCommand[this._options.command] === constants_1.SocksCommand.bind) { + /* If using BIND, the Socks client is now in BoundWaitingForConnection state. + This means that the remote proxy server is waiting for a remote connection to the bound port. */ + this.state = constants_1.SocksClientState.BoundWaitingForConnection; + this._nextRequiredPacketBufferSize = + constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader; + this.emit('bound', { socket: this._socket, remoteHost }); + /* + If using Associate, the Socks client is now Established. And the proxy server is now accepting UDP packets at the + given bound port. This initial Socks TCP connection must remain open for the UDP relay to continue to work. + */ + } + else if (constants_1.SocksCommand[this._options.command] === constants_1.SocksCommand.associate) { + this.state = constants_1.SocksClientState.Established; + this.removeInternalSocketHandlers(); + this.emit('established', { socket: this._socket, remoteHost }); + } + } + } + /** + * Handles Socks v5 incoming connection request (BIND). + */ + handleSocks5IncomingConnectionResponse() { + // Peek at available data (we need at least 5 bytes to get the hostname length) + const header = this._receiveBuffer.peek(5); + if (header[0] !== 0x05 || header[1] !== constants_1.Socks5Response.Granted) { + this._closeSocket(`${constants_1.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${constants_1.Socks5Response[header[1]]}`); + } + else { + // Read address type + const addressType = header[3]; + let remoteHost; + let buff; + // IPv4 + if (addressType === constants_1.Socks5HostType.IPv4) { + // Check if data is available. + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4; + if (this._receiveBuffer.length < dataNeeded) { + this._nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this._receiveBuffer.get(dataNeeded).slice(4)); + remoteHost = { + host: ip.fromLong(buff.readUInt32BE()), + port: buff.readUInt16BE() + }; + // If given host is 0.0.0.0, assume remote proxy ip instead. + if (remoteHost.host === '0.0.0.0') { + remoteHost.host = this._options.proxy.ipaddress; + } + // Hostname + } + else if (addressType === constants_1.Socks5HostType.Hostname) { + const hostLength = header[4]; + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength); // header + host length + port + // Check if data is available. + if (this._receiveBuffer.length < dataNeeded) { + this._nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this._receiveBuffer.get(dataNeeded).slice(5) // Slice at 5 to skip host length + ); + remoteHost = { + host: buff.readString(hostLength), + port: buff.readUInt16BE() + }; + // IPv6 + } + else if (addressType === constants_1.Socks5HostType.IPv6) { + // Check if data is available. + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; + if (this._receiveBuffer.length < dataNeeded) { + this._nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this._receiveBuffer.get(dataNeeded).slice(4)); + remoteHost = { + host: ip.toString(buff.readBuffer(16)), + port: buff.readUInt16BE() + }; + } + this.state = constants_1.SocksClientState.Established; + this.removeInternalSocketHandlers(); + this.emit('established', { socket: this._socket, remoteHost }); + } + } + get socksClientOptions() { + return Object.assign({}, this._options); + } +} +exports.SocksClient = SocksClient; +//# sourceMappingURL=socksclient.js.map
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/client/socksclient.js.map b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/client/socksclient.js.map new file mode 100644 index 000000000..da4dadf4e --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/client/socksclient.js.map @@ -0,0 +1 @@ +{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C;IACH,CAAC;IAED,IAAI,kBAAkB;QACpB,MAAM,mBACD,IAAI,CAAC,QAAQ,EAChB;IACJ,CAAC;CACF;AAGC,kCAAW"}
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/constants.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/constants.js new file mode 100644 index 000000000..4d68e6725 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/constants.js @@ -0,0 +1,105 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const DEFAULT_TIMEOUT = 30000; +exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT; +// prettier-ignore +const ERRORS = { + InvalidSocksCommand: 'An invalid SOCKS command was provided. Valid options are connect, bind, and associate.', + InvalidSocksCommandForOperation: 'An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.', + InvalidSocksCommandChain: 'An invalid SOCKS command was provided. Chaining currently only supports the connect command.', + InvalidSocksClientOptionsDestination: 'An invalid destination host was provided.', + InvalidSocksClientOptionsExistingSocket: 'An invalid existing socket was provided. This should be an instance of net.Socket.', + InvalidSocksClientOptionsProxy: 'Invalid SOCKS proxy details were provided.', + InvalidSocksClientOptionsTimeout: 'An invalid timeout value was provided. Please enter a value above 0 (in ms).', + InvalidSocksClientOptionsProxiesLength: 'At least two socks proxies must be provided for chaining.', + NegotiationError: 'Negotiation error', + SocketClosed: 'Socket closed', + ProxyConnectionTimedOut: 'Proxy connection timed out', + InternalError: 'SocksClient internal error (this should not happen)', + InvalidSocks4HandshakeResponse: 'Received invalid Socks4 handshake response', + Socks4ProxyRejectedConnection: 'Socks4 Proxy rejected connection', + InvalidSocks4IncomingConnectionResponse: 'Socks4 invalid incoming connection response', + Socks4ProxyRejectedIncomingBoundConnection: 'Socks4 Proxy rejected incoming bound connection', + InvalidSocks5InitialHandshakeResponse: 'Received invalid Socks5 initial handshake response', + InvalidSocks5IntiailHandshakeSocksVersion: 'Received invalid Socks5 initial handshake (invalid socks version)', + InvalidSocks5InitialHandshakeNoAcceptedAuthType: 'Received invalid Socks5 initial handshake (no accepted authentication type)', + InvalidSocks5InitialHandshakeUnknownAuthType: 'Received invalid Socks5 initial handshake (unknown authentication type)', + Socks5AuthenticationFailed: 'Socks5 Authentication failed', + InvalidSocks5FinalHandshake: 'Received invalid Socks5 final handshake response', + InvalidSocks5FinalHandshakeRejected: 'Socks5 proxy rejected connection', + InvalidSocks5IncomingConnectionResponse: 'Received invalid Socks5 incoming connection response', + Socks5ProxyRejectedIncomingBoundConnection: 'Socks5 Proxy rejected incoming bound connection', +}; +exports.ERRORS = ERRORS; +const SOCKS_INCOMING_PACKET_SIZES = { + Socks5InitialHandshakeResponse: 2, + Socks5UserPassAuthenticationResponse: 2, + // Command response + incoming connection (bind) + Socks5ResponseHeader: 5, + Socks5ResponseIPv4: 10, + Socks5ResponseIPv6: 22, + Socks5ResponseHostname: (hostNameLength) => hostNameLength + 7, + // Command response + incoming connection (bind) + Socks4Response: 8 // 2 header + 2 port + 4 ip +}; +exports.SOCKS_INCOMING_PACKET_SIZES = SOCKS_INCOMING_PACKET_SIZES; +var SocksCommand; +(function (SocksCommand) { + SocksCommand[SocksCommand["connect"] = 1] = "connect"; + SocksCommand[SocksCommand["bind"] = 2] = "bind"; + SocksCommand[SocksCommand["associate"] = 3] = "associate"; +})(SocksCommand || (SocksCommand = {})); +exports.SocksCommand = SocksCommand; +var Socks4Response; +(function (Socks4Response) { + Socks4Response[Socks4Response["Granted"] = 90] = "Granted"; + Socks4Response[Socks4Response["Failed"] = 91] = "Failed"; + Socks4Response[Socks4Response["Rejected"] = 92] = "Rejected"; + Socks4Response[Socks4Response["RejectedIdent"] = 93] = "RejectedIdent"; +})(Socks4Response || (Socks4Response = {})); +exports.Socks4Response = Socks4Response; +var Socks5Auth; +(function (Socks5Auth) { + Socks5Auth[Socks5Auth["NoAuth"] = 0] = "NoAuth"; + Socks5Auth[Socks5Auth["GSSApi"] = 1] = "GSSApi"; + Socks5Auth[Socks5Auth["UserPass"] = 2] = "UserPass"; +})(Socks5Auth || (Socks5Auth = {})); +exports.Socks5Auth = Socks5Auth; +var Socks5Response; +(function (Socks5Response) { + Socks5Response[Socks5Response["Granted"] = 0] = "Granted"; + Socks5Response[Socks5Response["Failure"] = 1] = "Failure"; + Socks5Response[Socks5Response["NotAllowed"] = 2] = "NotAllowed"; + Socks5Response[Socks5Response["NetworkUnreachable"] = 3] = "NetworkUnreachable"; + Socks5Response[Socks5Response["HostUnreachable"] = 4] = "HostUnreachable"; + Socks5Response[Socks5Response["ConnectionRefused"] = 5] = "ConnectionRefused"; + Socks5Response[Socks5Response["TTLExpired"] = 6] = "TTLExpired"; + Socks5Response[Socks5Response["CommandNotSupported"] = 7] = "CommandNotSupported"; + Socks5Response[Socks5Response["AddressNotSupported"] = 8] = "AddressNotSupported"; +})(Socks5Response || (Socks5Response = {})); +exports.Socks5Response = Socks5Response; +var Socks5HostType; +(function (Socks5HostType) { + Socks5HostType[Socks5HostType["IPv4"] = 1] = "IPv4"; + Socks5HostType[Socks5HostType["Hostname"] = 3] = "Hostname"; + Socks5HostType[Socks5HostType["IPv6"] = 4] = "IPv6"; +})(Socks5HostType || (Socks5HostType = {})); +exports.Socks5HostType = Socks5HostType; +var SocksClientState; +(function (SocksClientState) { + SocksClientState[SocksClientState["Created"] = 0] = "Created"; + SocksClientState[SocksClientState["Connecting"] = 1] = "Connecting"; + SocksClientState[SocksClientState["Connected"] = 2] = "Connected"; + SocksClientState[SocksClientState["SentInitialHandshake"] = 3] = "SentInitialHandshake"; + SocksClientState[SocksClientState["ReceivedInitialHandshakeResponse"] = 4] = "ReceivedInitialHandshakeResponse"; + SocksClientState[SocksClientState["SentAuthentication"] = 5] = "SentAuthentication"; + SocksClientState[SocksClientState["ReceivedAuthenticationResponse"] = 6] = "ReceivedAuthenticationResponse"; + SocksClientState[SocksClientState["SentFinalHandshake"] = 7] = "SentFinalHandshake"; + SocksClientState[SocksClientState["ReceivedFinalResponse"] = 8] = "ReceivedFinalResponse"; + SocksClientState[SocksClientState["BoundWaitingForConnection"] = 9] = "BoundWaitingForConnection"; + SocksClientState[SocksClientState["Established"] = 10] = "Established"; + SocksClientState[SocksClientState["Disconnected"] = 11] = "Disconnected"; + SocksClientState[SocksClientState["Error"] = 99] = "Error"; +})(SocksClientState || (SocksClientState = {})); +exports.SocksClientState = SocksClientState; +//# sourceMappingURL=constants.js.map
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/constants.js.map b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/constants.js.map new file mode 100644 index 000000000..6d0c7c01e --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/constants.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;AAEA,MAAM,eAAe,GAAG,KAAK,CAAC;AAoL5B,0CAAe;AAhLjB,kBAAkB;AAClB,MAAM,MAAM,GAAG;IACb,mBAAmB,EAAE,wFAAwF;IAC7G,+BAA+B,EAAE,oGAAoG;IACrI,wBAAwB,EAAE,8FAA8F;IACxH,oCAAoC,EAAE,2CAA2C;IACjF,uCAAuC,EAAE,oFAAoF;IAC7H,8BAA8B,EAAE,4CAA4C;IAC5E,gCAAgC,EAAE,8EAA8E;IAChH,sCAAsC,EAAE,2DAA2D;IACnG,gBAAgB,EAAE,mBAAmB;IACrC,YAAY,EAAE,eAAe;IAC7B,uBAAuB,EAAE,4BAA4B;IACrD,aAA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,IAAK,cAUJ;AAVD,WAAK,cAAc;IACjB,yDAAc,CAAA;IACd,yDAAc,CAAA;IACd,+DAAiB,CAAA;IACjB,+EAAyB,CAAA;IACzB,yEAAsB,CAAA;IACtB,6EAAwB,CAAA;IACxB,+DAAiB,CAAA;IACjB,iFAA0B,CAAA;IAC1B,iFAA0B,CAAA;AAC5B,CAAC,EAVI,cAAc,KAAd,cAAc,QAUlB;AA+GC,wCAAc;AA7GhB,IAAK,cAIJ;AAJD,WAAK,cAAc;IACjB,mDAAW,CAAA;IACX,2DAAe,CAAA;IACf,mDAAW,CAAA;AACb,CAAC,EAJI,cAAc,KAAd,cAAc,QAIlB;AAwGC,wCAAc;AAtGhB,IAAK,gBAcJ;AAdD,WAAK,gBAAgB;IACnB,6DAAW,CAAA;IACX,mEAAc,CAAA;IACd,iEAAa,CAAA;IACb,uFAAwB,CAAA;IACxB,+GAAoC,CAAA;IACpC,mFAAsB,CAAA;IACtB,2GAAkC,CAAA;IAClC,mFAAsB,CAAA;IACtB,yFAAyB,CAAA;IACzB,iGAA6B,CAAA;IAC7B,sEAAgB,CAAA;IAChB,wEAAiB,CAAA;IACjB,0DAAU,CAAA;AACZ,CAAC,EAdI,gBAAgB,KAAhB,gBAAgB,QAcpB;AA0FC,4CAAgB"}
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/helpers.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/helpers.js new file mode 100644 index 000000000..e06ba991a --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/helpers.js @@ -0,0 +1,100 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("./util"); +const constants_1 = require("./constants"); +const net = require("net"); +/** + * Validates the provided SocksClientOptions + * @param options { SocksClientOptions } + * @param acceptedCommands { string[] } A list of accepted SocksProxy commands. + */ +function validateSocksClientOptions(options, acceptedCommands = ['connect', 'bind', 'associate']) { + // Check SOCKs command option. + if (!constants_1.SocksCommand[options.command]) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommand, options); + } + // Check SocksCommand for acceptable command. + if (acceptedCommands.indexOf(options.command) === -1) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandForOperation, options); + } + // Check destination + if (!isValidSocksRemoteHost(options.destination)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options); + } + // Check SOCKS proxy to use + if (!isValidSocksProxy(options.proxy)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options); + } + // Check timeout + if (options.timeout && !isValidTimeoutValue(options.timeout)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options); + } + // Check existing_socket (if provided) + if (options.existing_socket && + !(options.existing_socket instanceof net.Socket)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsExistingSocket, options); + } +} +exports.validateSocksClientOptions = validateSocksClientOptions; +/** + * Validates the SocksClientChainOptions + * @param options { SocksClientChainOptions } + */ +function validateSocksClientChainOptions(options) { + // Only connect is supported when chaining. + if (options.command !== 'connect') { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandChain, options); + } + // Check destination + if (!isValidSocksRemoteHost(options.destination)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options); + } + // Validate proxies (length) + if (!(options.proxies && + Array.isArray(options.proxies) && + options.proxies.length >= 2)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxiesLength, options); + } + // Validate proxies + options.proxies.forEach((proxy) => { + if (!isValidSocksProxy(proxy)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options); + } + }); + // Check timeout + if (options.timeout && !isValidTimeoutValue(options.timeout)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options); + } +} +exports.validateSocksClientChainOptions = validateSocksClientChainOptions; +/** + * Validates a SocksRemoteHost + * @param remoteHost { SocksRemoteHost } + */ +function isValidSocksRemoteHost(remoteHost) { + return (remoteHost && + typeof remoteHost.host === 'string' && + typeof remoteHost.port === 'number' && + remoteHost.port >= 0 && + remoteHost.port <= 65535); +} +/** + * Validates a SocksProxy + * @param proxy { SocksProxy } + */ +function isValidSocksProxy(proxy) { + return (proxy && + net.isIP(proxy.ipaddress) && + typeof proxy.port === 'number' && + proxy.port >= 0 && + proxy.port <= 65535 && + (proxy.type === 4 || proxy.type === 5)); +} +/** + * Validates a timeout value. + * @param value { Number } + */ +function isValidTimeoutValue(value) { + return typeof value === 'number' && value > 0; +} +//# sourceMappingURL=helpers.js.map
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/helpers.js.map b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/helpers.js.map new file mode 100644 index 000000000..cefc753dc --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/common/helpers.ts"],"names":[],"mappings":";;AAKA,iCAA0C;AAC1C,2CAA+D;AAC/D,2BAA2B;AAE3B;;;;GAIG;AACH,oCACE,OAA2B,EAC3B,gBAAgB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC;IAEnD,8BAA8B;IAC9B,EAAE,CAAC,CAAC,CAAC,wBAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CA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AAQ;QACnC,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;QACnC,UAAU,CAAC,IAAI,IAAI,CAAC;QACpB,UAAU,CAAC,IAAI,IAAI,KAAK,CACzB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,2BAA2B,KAAiB;IAC1C,MAAM,CAAC,CACL,KAAK;QACL,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;QACzB,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAC9B,KAAK,CAAC,IAAI,IAAI,CAAC;QACf,KAAK,CAAC,IAAI,IAAI,KAAK;QACnB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CACvC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,6BAA6B,KAAa;IACxC,MAAM,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC;AAChD,CAAC"}
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/receivebuffer.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/receivebuffer.js new file mode 100644 index 000000000..180fa749d --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/receivebuffer.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ReceiveBuffer { + constructor(size = 4096) { + this._buffer = Buffer.allocUnsafe(size); + this._offset = 0; + this._originalSize = size; + } + get length() { + return this._offset; + } + append(data) { + if (!Buffer.isBuffer(data)) { + throw new Error('Attempted to append a non-buffer instance to ReceiveBuffer.'); + } + if (this._offset + data.length >= this._buffer.length) { + const tmp = this._buffer; + this._buffer = Buffer.allocUnsafe(Math.max(this._buffer.length + this._originalSize, this._buffer.length + data.length)); + tmp.copy(this._buffer); + } + data.copy(this._buffer, this._offset); + return (this._offset += data.length); + } + peek(length) { + if (length > this._offset) { + throw new Error('Attempted to read beyond the bounds of the managed internal data.'); + } + return this._buffer.slice(0, length); + } + get(length) { + if (length > this._offset) { + throw new Error('Attempted to read beyond the bounds of the managed internal data.'); + } + const value = Buffer.allocUnsafe(length); + this._buffer.slice(0, length).copy(value); + this._buffer.copyWithin(0, length, length + this._offset - length); + this._offset -= length; + return value; + } +} +exports.ReceiveBuffer = ReceiveBuffer; +//# sourceMappingURL=receivebuffer.js.map
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/receivebuffer.js.map b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/receivebuffer.js.map new file mode 100644 index 000000000..cc0095197 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/receivebuffer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"receivebuffer.js","sourceRoot":"","sources":["../../src/common/receivebuffer.ts"],"names":[],"mappings":";;AAAA;IAKE,YAAY,OAAe,IAAI;QAC7B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC5B,CAAC;IAED,IAAI,MAAM;QACR,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,6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AC1C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;QACnE,IAAI,CAAC,OAAO,IAAI,MAAM,CAAC;QAEvB,MAAM,CAAC,KAAK,CAAC;IACf,CAAC;CACF;AAEQ,sCAAa"}
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/util.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/util.js new file mode 100644 index 000000000..347d9292f --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/util.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Error wrapper for SocksClient + */ +class SocksClientError extends Error { + constructor(message, options) { + super(message); + this.options = options; + } +} +exports.SocksClientError = SocksClientError; +/** + * Shuffles a given array. + * @param array The array to shuffle. + */ +function shuffleArray(array) { + for (let i = array.length - 1; i > 0; i--) { + let j = Math.floor(Math.random() * (i + 1)); + [array[i], array[j]] = [array[j], array[i]]; + } +} +exports.shuffleArray = shuffleArray; +//# sourceMappingURL=util.js.map
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/util.js.map b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/util.js.map new file mode 100644 index 000000000..c23ff5941 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/common/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/common/util.ts"],"names":[],"mappings":";;AAEA;;GAEG;AACH,sBAAuB,SAAQ,KAAK;IAClC,YACE,OAAe,EACR,OAAqD;QAE5D,KAAK,CAAC,OAAO,CAAC,CAAC;QAFR,YAAO,GAAP,OAAO,CAA8C;IAG9D,CAAC;CACF;AAaQ,4CAAgB;AAXzB;;;GAGG;AACH,sBAAsB,KAAY;IAChC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5C,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC;AAE0B,oCAAY"}
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/index.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/index.js new file mode 100644 index 000000000..e017b095d --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/index.js @@ -0,0 +1,7 @@ +"use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("./client/socksclient")); +//# sourceMappingURL=index.js.map
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/index.js.map b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/index.js.map new file mode 100644 index 000000000..435a74647 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/build/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,0CAAqC"}
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/index.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/index.md new file mode 100644 index 000000000..87bfe250e --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/index.md @@ -0,0 +1,17 @@ +# socks examples + +## TypeScript Examples + +[Connect command](typescript/connectExample.md) + +[Bind command](typescript/bindExample.md) + +[Associate command](typescript/associateExample.md) + +## JavaScript Examples + +[Connect command](javascript/connectExample.md) + +[Bind command](javascript/bindExample.md) + +[Associate command](javascript/associateExample.md)
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/javascript/associateExample.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/javascript/associateExample.md new file mode 100644 index 000000000..a29cb2fc2 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/javascript/associateExample.md @@ -0,0 +1,90 @@ +# socks examples + +## Example for SOCKS 'associate' command + +The associate command tells the SOCKS proxy server to establish a UDP relay. The server binds to a new UDP port and communicates the newly opened port back to the origin client. From here, any SOCKS UDP frame packets sent to this special UDP port on the Proxy server will be forwarded to the desired destination, and any responses will be forwarded back to the origin client (you). + +This can be used for things such as DNS queries, and other UDP communicates. + +**Connection Steps** + +1. Client -(associate)-> Proxy (Tells the proxy to create a UDP relay and bind on a new port) +2. Client <-(port)- Proxy (Tells the origin client which port it opened and is accepting UDP frame packets on) + +At this point the proxy is accepting UDP frames on the specified port. + +3. Client --(udp frame) -> Proxy -> Destination (The origin client sends a UDP frame to the proxy on the UDP port, and the proxy then forwards it to the destination specified in the UDP frame.) +4. Client <--(udp frame) <-- Proxy <-- Destination (The destination client responds to the udp packet sent in #3) + +## Usage + +The 'associate' command can only be used by creating a new SocksClient instance and listening for the 'established' event. + +**Note:** UDP packets relayed through the proxy servers are encompassed in a special Socks UDP frame format. SocksClient.createUDPFrame() and SocksClient.parseUDPFrame() create and parse these special UDP packets. + +```typescript +const dgram = require('dgram'); +const SocksClient = require('socks').SocksClient; + +// Create a local UDP socket for sending/receiving packets to/from the proxy. +const udpSocket = dgram.createSocket('udp4'); +udpSocket.bind(); + +// Listen for incoming UDP packets from the proxy server. +udpSocket.on('message', (message, rinfo) => { + console.log(SocksClient.parseUDPFrame(message)); + /* + { frameNumber: 0, + remoteHost: { host: '8.8.8.8', port: 53 }, // The remote host that replied with a UDP packet + data: <Buffer 74 65 73 74 0a> // The data + } + */ +}); + +const options = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + // This should be the ip and port of the expected client that will be sending UDP frames to the newly opened UDP port on the server. + // Most SOCKS servers accept 0.0.0.0 as a wildcard address to accept UDP frames from any source. + destination: { + host: '0.0.0.0', + port: 0 + }, + + command: 'associate' +}; + +const client = new SocksClient(options); + +// This event is fired when the SOCKS server has started listening on a new UDP port for UDP relaying. +client.on('established', info => { + console.log(info); + /* + { + socket: <Socket ...>, + remoteHost: { // This is the remote port on the SOCKS proxy server to send UDP frame packets to. + host: '104.131.124.203', + port: 58232 + } + } + */ + + // Send a udp frame to 8.8.8.8 on port 53 through the proxy. + const packet = SocksClient.createUDPFrame({ + remoteHost: { host: '8.8.8.8', port: 53 }, + data: Buffer.from('hello') // A DNS lookup in the real world. + }); + + // Send packet. + udpSocket.send(packet, info.remoteHost.port, info.remoteHost.host); +}); + +// SOCKS proxy failed to bind. +client.on('error', () => { + // Handle errors +}); +``` diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/javascript/bindExample.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/javascript/bindExample.md new file mode 100644 index 000000000..ee60bff44 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/javascript/bindExample.md @@ -0,0 +1,83 @@ +# socks examples + +## Example for SOCKS 'bind' command + +The bind command tells the SOCKS proxy server to bind and listen on a new TCP port for an incoming connection. It communicates the newly opened port back to the origin client. Once a incoming connection is accepted by the SOCKS proxy server it then communicates the remote host that connected to the SOCKS proxy back through the same initial connection via the origin client. + +This can be used for things such as FTP clients which require incoming TCP connections, etc. + +**Connection Steps** + +1. Client -(bind)-> Proxy (Tells the proxy to bind to a new port) +2. Client <-(port)- Proxy (Tells the origin client which port it opened) +3. Client2 --> Proxy (Other client connects to the proxy on this port) +4. Client <--(client2's host info) (Proxy tells the origin client who connected to it) +5. Original connection to the proxy is now a full TCP stream between client (you) and client2. +6. Client <--> Proxy <--> Client2 + + +## Usage + +The 'bind' command can only be used by creating a new SocksClient instance and listening for 'bound' and 'established' events. + + +```typescript +const SocksClient = require('socks').SocksClient; + +const options = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + // This should be the ip and port of the expected client that will connect to the SOCKS proxy server on the newly bound port. + // Most SOCKS servers accept 0.0.0.0 as a wildcard address to accept any client. + destination: { + host: '0.0.0.0', + port: 0 + }, + + command: 'bind' +}; + +const client = new SocksClient(options); + +// This event is fired when the SOCKS server has started listening on a new port for incoming connections. +client.on('bound', (info) => { + console.log(info); + /* + { + socket: <Socket ...>, + remoteHost: { // This is the remote ip and port of the SOCKS proxy that is now accepting incoming connections. + host: '104.131.124.203', + port: 49928 + } + } + */ +}); + +// This event is fired when the SOCKS server has accepted an incoming connection on the newly bound port. +client.on('established', (info) => { + console.log(info); + /* + { + socket: <Socket ...>, + remoteHost: { // This is the remote ip and port that connected to the SOCKS proxy on the newly bound port. + host: '1.2.3.4', + port: 58232 + } + } + */ + + // At this point info.socket is a regular net.Socket TCP connection between client and client2 (1.2.3.4) (the client which connected to the proxy on the newly bound port.) + + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy servers) +}); + +// SOCKS proxy failed to bind. +client.on('error', () => { + // Handle errors +}); +```
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/javascript/connectExample.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/javascript/connectExample.md new file mode 100644 index 000000000..ae98c8ff0 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/javascript/connectExample.md @@ -0,0 +1,258 @@ +# socks examples + +## Example for SOCKS 'connect' command + +The connect command is the most common use-case for a SOCKS proxy. This establishes a direct connection to a destination host through a proxy server. The destination host only has knowledge of the proxy server connecting to it and does not know about the origin client (you). + +**Origin Client (you) <-> Proxy Server <-> Destination Server** + +In this example, we are connecting to a web server on port 80, and sending a very basic HTTP request to receive a response. It's worth noting that there are many socks-http-agents that can be used with the node http module (and libraries such as request.js) to make this easier. This HTTP request is used as a simple example. + +The 'connect' command can be used via the SocksClient.createConnection() factory function as well as by creating a SocksClient instance and using event handlers. + +### Using createConnection with async/await + +Since SocksClient.createConnection returns a Promise, we can easily use async/await for flow control. + +```typescript +const SocksClient = require('socks').SocksClient; + +const options = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +async function start() { + try { + const info = await SocksClient.createConnection(options); + + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + } catch (err) { + // Handle errors + } +} + +start(); +``` + +### Using createConnection with Promises + +```typescript +const SocksClient = require('socks').SocksClient; + +const options = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +SocksClient.createConnection(options) +.then(info => { + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ +}) +.catch(err => { + // handle errors +}); +``` + +### Using createConnection with callbacks + +SocksClient.createConnection() optionally accepts a callback function as a second parameter. + +**Note:** If a callback function is provided, a Promise is still returned from the function, but the promise will always resolve regardless of if there was en error. (tldr: Do not mix callbacks and Promises). + +```typescript +const SocksClient = require('socks').SocksClient; + +const options = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +SocksClient.createConnection(options, (err, info) => { + if (err) { + // handle errors + } else { + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + } +}) +``` + +### Using event handlers + +SocksClient also supports instance creation of a SocksClient. This allows for event based flow control. + +```typescript +const SocksClient = require('socks').SocksClient; + +const options = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +const client = new SocksClient(options); + +client.on('established', (info) => { + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ +}); + +// Failed to establish proxy connection to destination. +client.on('error', () => { + // Handle errors +}); +```
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/typescript/associateExample.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/typescript/associateExample.md new file mode 100644 index 000000000..d00947938 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/typescript/associateExample.md @@ -0,0 +1,93 @@ +# socks examples + +## Example for SOCKS 'associate' command + +The associate command tells the SOCKS proxy server to establish a UDP relay. The server binds to a new UDP port and communicates the newly opened port back to the origin client. From here, any SOCKS UDP frame packets sent to this special UDP port on the Proxy server will be forwarded to the desired destination, and any responses will be forwarded back to the origin client (you). + +This can be used for things such as DNS queries, and other UDP communicates. + +**Connection Steps** + +1. Client -(associate)-> Proxy (Tells the proxy to create a UDP relay and bind on a new port) +2. Client <-(port)- Proxy (Tells the origin client which port it opened and is accepting UDP frame packets on) + +At this point the proxy is accepting UDP frames on the specified port. + +3. Client --(udp frame) -> Proxy -> Destination (The origin client sends a UDP frame to the proxy on the UDP port, and the proxy then forwards it to the destination specified in the UDP frame.) +4. Client <--(udp frame) <-- Proxy <-- Destination (The destination client responds to the udp packet sent in #3) + +## Usage + +The 'associate' command can only be used by creating a new SocksClient instance and listening for the 'established' event. + +**Note:** UDP packets relayed through the proxy servers are packaged in a special Socks UDP frame format. SocksClient.createUDPFrame() and SocksClient.parseUDPFrame() create and parse these special UDP packets. + +```typescript +import * as dgram from 'dgram'; +import { SocksClient, SocksClientOptions } from 'socks'; + +// Create a local UDP socket for sending/receiving packets to/from the proxy. +const udpSocket = dgram.createSocket('udp4'); +udpSocket.bind(); + +// Listen for incoming UDP packets from the proxy server. +udpSocket.on('message', (message, rinfo) => { + console.log(SocksClient.parseUDPFrame(message)); + /* + { frameNumber: 0, + remoteHost: { host: '8.8.8.8', port: 53 }, // The remote host that replied with a UDP packet + data: <Buffer 74 65 73 74 0a> // The data + } + */ +}); + +const options: SocksClientOptions = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + // This should be the ip and port of the expected client that will be sending UDP frames to the newly opened UDP port on the server. + // Most SOCKS servers accept 0.0.0.0 as a wildcard address to accept UDP frames from any source. + destination: { + host: '0.0.0.0', + port: 0 + }, + + command: 'associate' +}; + +const client = new SocksClient(options); + +// This event is fired when the SOCKS server has started listening on a new UDP port for UDP relaying. +client.on('established', info => { + console.log(info); + /* + { + socket: <Socket ...>, + remoteHost: { // This is the remote port on the SOCKS proxy server to send UDP frame packets to. + host: '104.131.124.203', + port: 58232 + } + } + */ + + // Send a udp frame to 8.8.8.8 on port 53 through the proxy. + const packet = SocksClient.createUDPFrame({ + remoteHost: { host: '8.8.8.8', port: 53 }, + data: Buffer.from('hello') // A DNS lookup in the real world. + }); + + // Send packet. + udpSocket.send(packet, info.remoteHost.port, info.remoteHost.host); +}); + +// SOCKS proxy failed to bind. +client.on('error', () => { + // Handle errors +}); + +// Start connection +client.connect(); +``` diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/typescript/bindExample.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/typescript/bindExample.md new file mode 100644 index 000000000..f0f4ae399 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/typescript/bindExample.md @@ -0,0 +1,86 @@ +# socks examples + +## Example for SOCKS 'bind' command + +The bind command tells the SOCKS proxy server to bind and listen on a new TCP port for an incoming connection. It communicates the newly opened port back to the origin client. Once a incoming connection is accepted by the SOCKS proxy server it then communicates the remote host that connected to the SOCKS proxy back through the same initial connection via the origin client. + +This can be used for things such as FTP clients which require incoming TCP connections, etc. + +**Connection Steps** + +1. Client -(bind)-> Proxy (Tells the proxy to bind to a new port) +2. Client <-(port)- Proxy (Tells the origin client which port it opened) +3. Client2 --> Proxy (Other client connects to the proxy on this port) +4. Client <--(client2's host info) (Proxy tells the origin client who connected to it) +5. Original connection to the proxy is now a full TCP stream between client (you) and client2. +6. Client <--> Proxy <--> Client2 + + +## Usage + +The 'bind' command can only be used by creating a new SocksClient instance and listening for 'bound' and 'established' events. + + +```typescript +import { SocksClient, SocksClientOptions } from 'socks'; + +const options: SocksClientOptions = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + // This should be the ip and port of the expected client that will connect to the SOCKS proxy server on the newly bound port. + // Most SOCKS servers accept 0.0.0.0 as a wildcard address to accept any client. + destination: { + host: '0.0.0.0', + port: 0 + }, + + command: 'bind' +}; + +const client = new SocksClient(options); + +// This event is fired when the SOCKS server has started listening on a new port for incoming connections. +client.on('bound', (info) => { + console.log(info); + /* + { + socket: <Socket ...>, + remoteHost: { // This is the remote ip and port of the SOCKS proxy that is now accepting incoming connections. + host: '104.131.124.203', + port: 49928 + } + } + */ +}); + +// This event is fired when the SOCKS server has accepted an incoming connection on the newly bound port. +client.on('established', (info) => { + console.log(info); + /* + { + socket: <Socket ...>, + remoteHost: { // This is the remote ip and port that connected to the SOCKS proxy on the newly bound port. + host: '1.2.3.4', + port: 58232 + } + } + */ + + // At this point info.socket is a regular net.Socket TCP connection between client and client2 (1.2.3.4) (the client which connected to the proxy on the newly bound port.) + + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy servers) +}); + +// SOCKS proxy failed to bind. +client.on('error', () => { + // Handle errors +}); + +// Start connection +client.connect(); +```
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/typescript/connectExample.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/typescript/connectExample.md new file mode 100644 index 000000000..04369df3e --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/examples/typescript/connectExample.md @@ -0,0 +1,265 @@ +# socks examples + +## Example for SOCKS 'connect' command + +The connect command is the most common use-case for a SOCKS proxy. This establishes a direct connection to a destination host through a proxy server. The destination host only has knowledge of the proxy server connecting to it and does not know about the origin client (you). + +**Origin Client (you) <-> Proxy Server <-> Destination Server** + +In this example, we are connecting to a web server on port 80, and sending a very basic HTTP request to receive a response. It's worth noting that there are many socks-http-agents that can be used with the node http module (and libraries such as request.js) to make this easier. This HTTP request is used as a simple example. + +The 'connect' command can be used via the SocksClient.createConnection() factory function as well as by creating a SocksClient instance and using event handlers. + +### Using createConnection with async/await + +Since SocksClient.createConnection returns a Promise, we can easily use async/await for flow control. + +```typescript +import { SocksClient, SocksClientOptions } from 'socks'; + +const options: SocksClientOptions = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +async function start() { + try { + const info = await SocksClient.createConnection(options); + + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + }); + } catch (err) { + // Handle errors + } +} + +start(); +``` + +### Using createConnection with Promises + +```typescript +import { SocksClient, SocksClientOptions } from 'socks'; + +const options: SocksClientOptions = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +SocksClient.createConnection(options) +.then(info => { + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + }); +}) +.catch(err => { + // handle errors +}); +``` + +### Using createConnection with callbacks + +SocksClient.createConnection() optionally accepts a callback function as a second parameter. + +**Note:** If a callback function is provided, a Promise is still returned from the function, but the promise will always resolve regardless of if there was en error. (tldr: Do not mix callbacks and Promises). + +```typescript +import { SocksClient, SocksClientOptions } from 'socks'; + +const options: SocksClientOptions = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +SocksClient.createConnection(options, (err, info) => { + if (err) { + // handle errors + } else { + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + }); + } +}) +``` + +### Using event handlers + +SocksClient also supports instance creation of a SocksClient. This allows for event based flow control. + +```typescript +import { SocksClient, SocksClientOptions } from 'socks'; + +const options: SocksClientOptions = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +const client = new SocksClient(options); + +client.on('established', (info) => { + console.log(info.socket); + // <Socket ...> (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + }); +}); + +// Failed to establish proxy connection to destination. +client.on('error', () => { + // Handle errors +}); + +// Start connection +client.connect(); +```
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/index.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/index.md new file mode 100644 index 000000000..3eb1d7118 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/index.md @@ -0,0 +1,5 @@ +# Documentation + +- [API Reference](https://github.com/JoshGlazebrook/socks#api-reference) + +- [Code Examples](./examples/index.md)
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/migratingFromV1.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/migratingFromV1.md new file mode 100644 index 000000000..dd008384b --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/docs/migratingFromV1.md @@ -0,0 +1,86 @@ +# socks + +## Migrating from v1 + +For the most part, migrating from v1 takes minimal effort as v2 still supports factory creation of proxy connections with callback support. + +### Notable breaking changes + +- In an options object, the proxy 'command' is now required and does not default to 'connect'. +- **In an options object, 'target' is now known as 'destination'.** +- Sockets are no longer paused after a SOCKS connection is made, so socket.resume() is no longer required. (Please be sure to attach data handlers immediately to the Socket to avoid losing data). +- In v2, only the 'connect' command is supported via the factory SocksClient.createConnection function. (BIND and ASSOCIATE must be used with a SocksClient instance via event handlers). +- In v2, the factory SocksClient.createConnection function callback is called with a single object rather than separate socket and info object. +- A SOCKS http/https agent is no longer bundled into the library. + +For informational purposes, here is the original getting started example from v1 converted to work with v2. + +### Before (v1) + +```javascript +var Socks = require('socks'); + +var options = { + proxy: { + ipaddress: "202.101.228.108", + port: 1080, + type: 5 + }, + target: { + host: "google.com", + port: 80 + }, + command: 'connect' +}; + +Socks.createConnection(options, function(err, socket, info) { + if (err) + console.log(err); + else { + 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... + } +}); +``` + +### After (v2) +```javascript +const SocksClient = require('socks').SocksClient; + +let options = { + proxy: { + ipaddress: "202.101.228.108", + port: 1080, + type: 5 + }, + destination: { + host: "google.com", + port: 80 + }, + command: 'connect' +}; + +SocksClient.createConnection(options, function(err, result) { + if (err) + console.log(err); + else { + result.socket.write("GET / HTTP/1.1\nHost: google.com\n\n"); + result.socket.on('data', function(data) { + console.log(data.length); + console.log(data); + }); + + // 569 + // <Buffer 48 54 54 50 2f 31 2e 31 20 33 30 31 20 4d 6f 76 65 64 20 50 65... + } +}); +```
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/associate.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/associate.js deleted file mode 100644 index 82d6afa97..000000000 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/associate.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/bind.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/bind.js deleted file mode 100644 index 4410dd1de..000000000 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/bind.js +++ /dev/null @@ -1,30 +0,0 @@ -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/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/connect.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/connect.js deleted file mode 100644 index 528ad4d41..000000000 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/connect.js +++ /dev/null @@ -1,31 +0,0 @@ -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/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/index.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/index.js deleted file mode 100644 index 29331d4a1..000000000 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/index.js +++ /dev/null @@ -1,6 +0,0 @@ -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/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-agent.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-agent.js deleted file mode 100644 index db1c301ec..000000000 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-agent.js +++ /dev/null @@ -1,108 +0,0 @@ -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/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-client.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-client.js deleted file mode 100644 index 4a31f62c3..000000000 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-client.js +++ /dev/null @@ -1,306 +0,0 @@ -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/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.npmignore b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.npmignore deleted file mode 100644 index 6bcbf6f77..000000000 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -.git* -.idea* -node_modules/ -npm-debug.log -coverage
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.travis.yml b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.travis.yml index 9d67de587..c362cb3bc 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.travis.yml +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.travis.yml @@ -1,11 +1,12 @@ language: node_js node_js: - - 0.10 - - 0.12 - 4 - 6 + - 7 - 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 +before_script: + - npm install -g typescript + - tsc -p ./ + +script: "npm run coveralls"
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/LICENSE b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/LICENSE index b2442a9e7..aab5771a9 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/LICENSE +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013 Josh Glazebrook +Copyright (c) 2013-2017 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 diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/README.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/README.md index 178ce8827..4cd328d9e 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/README.md +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/README.md @@ -1,32 +1,65 @@ 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. +smart-buffer is a Buffer wrapper that adds automatic read & write offset tracking, string operations, data insertions, and more. +![stats](https://nodei.co/npm/smart-buffer.png?downloads=true&downloadRank=true&stars=true "stats") -### What it's useful for: +**Key Features**: +* Proxies all of the Buffer write and read functions +* Keeps track of read and write offsets automatically +* Grows the internal Buffer as needed +* Useful string operations. (Null terminating strings) +* Allows for inserting values at specific points in the Buffer +* Built in TypeScript +* Type Definitions Provided +* Browser Support (using Webpack/Browserify) +* Full test coverage -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. +**Requirements**: +* Node v4.0+ is supported at this time. (Versions prior to 2.0 will work on node 0.10) -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. + +## Breaking Changes in v4.0 + +* Old constructor patterns have been completely removed. It's now required to use the SmartBuffer.fromXXX() factory constructors. +* rewind(), skip(), moveTo() have been removed. (see [offsets](#offsets)) +* Internal private properties are now prefixed with underscores (_) +* **All** writeXXX() methods that are given an offset will now **overwrite data** instead of insert. (see [write vs insert](#write-vs-insert)) +* insertXXX() methods have been added for when you want to insert data at a specific offset (this replaces the old behavior of writeXXX() when an offset was provided) + + +## Looking for v3 docs? + +Legacy documentation for version 3 and prior can be found [here](https://github.com/JoshGlazebrook/smart-buffer/blob/master/docs/README_v3.md). ## Installing: +`yarn add smart-buffer` + +or + `npm install smart-buffer` +Note: The published NPM package includes the built javascript library. +If you cloned this repo and wish to build the library manually use: + +`npm run build` + ## Using smart-buffer -### Example +```javascript +// Javascript +const SmartBuffer = require('smart-buffer').SmartBuffer; + +// Typescript +import { SmartBuffer, SmartBufferOptions} from 'smart-buffer'; +``` -Say you were building a packet that had to conform to the following protocol: +### Simple Example + +Building a packet that uses the following protocol specification: `[PacketType:2][PacketLength:2][Data:XX]` @@ -34,31 +67,31 @@ To build this packet using the vanilla Buffer class, you would have to count up ```javascript function createLoginPacket(username, password, age, country) { - var packet = new SmartBuffer(); - packet.writeUInt16LE(0x0060); // Login Packet Type/ID + const packet = new SmartBuffer(); + packet.writeUInt16LE(0x0060); // Some packet type packet.writeStringNT(username); packet.writeStringNT(password); packet.writeUInt8(age); packet.writeStringNT(country); - packet.writeUInt16LE(packet.length - 2, 2); + packet.insertUInt16LE(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"); +const 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. +Notice that the `[PacketLength:2]` value (1e 00) was inserted at position 2. Reading back the packet we created above is just as easy: ```javascript -var reader = new SmartBuffer(login); +const reader = SmartBuffer.fromBuffer(login); -var logininfo = { +const logininfo = { packetType: reader.readUInt16LE(), packetLength: reader.readUInt16LE(), username: reader.readStringNT(), @@ -75,232 +108,524 @@ var logininfo = { password: 'secret123', age: 22, country: 'United States' -}; +} */ ``` -# Api Reference: -### Constructing a smart-buffer +## Write vs Insert +In prior versions of SmartBuffer, .writeXXX(value, offset) calls would insert data when an offset was provided. In version 4, this will now overwrite the data at the offset position. To insert data there are now corresponding .insertXXX(value, offset) methods. -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. +**SmartBuffer v3**: +```javascript +const buff = SmartBuffer.fromBuffer(new Buffer([1,2,3,4,5,6])); +buff.writeInt8(7, 2); +console.log(buff.toBuffer()) + +// <Buffer 01 02 07 03 04 05 06> +``` +**SmartBuffer v4**: ```javascript -var SmartBuffer = require('smart-buffer'); +const buff = SmartBuffer.fromBuffer(new Buffer([1,2,3,4,5,6])); +buff.writeInt8(7, 2); +console.log(buff.toBuffer()); -// Reading from an existing Buffer: -var reader = new SmartBuffer(buffer); -var reader = new SmartBuffer(buffer, 'ascii'); +// <Buffer 01 02 07 04 05 06> +``` + +To insert you instead should use: +```javascript +const buff = SmartBuffer.fromBuffer(new Buffer([1,2,3,4,5,6])); +buff.insertInt8(7, 2); +console.log(buff.toBuffer()); -// 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. +// <Buffer 01 02 07 03 04 05 06> ``` -## Reading Data +**Note:** Insert/Writing to a position beyond the currently tracked internal Buffer will zero pad to your offset. -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. +## Constructing a smart-buffer -## Reading Numeric Values +There are a few different ways to construct a SmartBuffer instance. -When numeric values, you simply need to call the function you want, and the data is returned. +```javascript +// Creating SmartBuffer from existing Buffer +const buff = SmartBuffer.fromBuffer(buffer); // Creates instance from buffer. (Uses default utf8 encoding) +const buff = SmartBuffer.fromBuffer(buffer, 'ascii'); // Creates instance from buffer with ascii encoding for strings. + +// Creating SmartBuffer with specified internal Buffer size. (Note: this is not a hard cap, the internal buffer will grow as needed). +const buff = SmartBuffer.fromSize(1024); // Creates instance with internal Buffer size of 1024. +const buff = SmartBuffer.fromSize(1024, 'utf8'); // Creates instance with internal Buffer size of 1024, and utf8 encoding for strings. + +// Creating SmartBuffer with options object. This one specifies size and encoding. +const buff = SmartBuffer.fromOptions({ + size: 1024, + encoding: 'ascii' +}); + +// Creating SmartBuffer with options object. This one specified an existing Buffer. +const buff = SmartBuffer.fromOptions({ + buff: buffer +}); + +// Creating SmartBuffer from a string. +const buff = SmartBuffer.fromBuffer(Buffer.from('some string', 'utf8')); + +// Just want a regular SmartBuffer with all default options? +const buff = new SmartBuffer(); +``` -Supported Operations: -* readInt8 -* readInt16BE -* readInt16LE -* readInt32BE -* readInt32LE -* readUInt8 -* readUInt16BE -* readUInt16LE -* readUInt32BE -* readUInt32LE -* readFloatBE -* readFloatLE -* readDoubleBE -* readDoubleLE +# Api Reference: +**Note:** SmartBuffer is fully documented with Typescript definitions as well as jsdocs so your favorite editor/IDE will have intellisense. + +**Table of Contents** + +1. [Constructing](#constructing) +2. **Numbers** + 1. [Integers](#integers) + 2. [Floating Points](#floating-point-numbers) +3. **Strings** + 1. [Strings](#strings) + 2. [Null Terminated Strings](#null-terminated-strings) +4. [Buffers](#buffers) +5. [Offsets](#offsets) +6. [Other](#other) + + +## Constructing + +### constructor() +### constructor([options]) +- ```options``` *{SmartBufferOptions}* An optional options object to construct a SmartBuffer with. + +Examples: ```javascript -var reader = new SmartBuffer(somebuffer); -var num = reader.readInt8(); +const buff = new SmartBuffer(); +const buff = new SmartBuffer({ + size: 1024, + encoding: 'ascii' +}); ``` -## Reading String Values +### Class Method: fromBuffer(buffer[, encoding]) +- ```buffer``` *{Buffer}* The Buffer instance to wrap. +- ```encoding``` *{string}* The string encoding to use. ```Default: 'utf8'``` -When reading String values, you can either choose to read a null terminated string, or a string of a specified length. +Examples: +```javascript +const someBuffer = Buffer.from('some string'); +const buff = SmartBuffer.fromBuffer(someBuffer); // Defaults to utf8 +const buff = SmartBuffer.fromBuffer(someBuffer, 'ascii'); +``` -### SmartBuffer.readStringNT( [encoding] ) -> `String` **String encoding to use** - Defaults to the encoding set in the constructor, or utf8. +### Class Method: fromSize(size[, encoding]) +- ```size``` *{number}* The size to initialize the internal Buffer. +- ```encoding``` *{string}* The string encoding to use. ```Default: 'utf8'``` -returns `String` +Examples: +```javascript +const buff = SmartBuffer.fromSize(1024); // Defaults to utf8 +const buff = SmartBuffer.fromSize(1024, 'ascii'); +``` -> Note: When readStringNT is called and there is no null character found, smart-buffer will read to the end of the internal Buffer. +### Class Method: fromOptions(options) +- ```options``` *{SmartBufferOptions}* The Buffer instance to wrap. -### SmartBuffer.readString( [length], [encoding] ) -### SmartBuffer.readString( [length] ) -### SmartBuffer.readString( [encoding] ) -> `Number` **Length of the string to read** +```typescript +interface SmartBufferOptions { + encoding?: BufferEncoding; // Defaults to utf8 + size?: number; // Defaults to 4096 + buff?: Buffer; +} +``` -> `String` **String encoding to use** - Defaults to the encoding set in the constructor, or utf8. +Examples: +```javascript +const buff = SmartBuffer.fromOptions({ + size: 1024 +}; +const buff = SmartBuffer.fromOptions({ + size: 1024, + encoding: 'utf8' +}); +const buff = SmartBuffer.fromOptions({ + encoding: 'utf8' +}); + +const someBuff = Buffer.from('some string', 'utf8'); +const buff = SmartBuffer.fromOptions({ + buffer: someBuff, + encoding: 'utf8' +}); +``` -returns `String` +## Integers -> Note: When readString is called without a specified length, smart-buffer will read to the end of the internal Buffer. +### readInt8([offset]) +- ```offset``` *{number}* Optional position to start reading data from. **Default**: ```Auto managed offset``` +- Returns *{number}* +Read a Int8 value. +### buff.readInt16BE([offset]) +### buff.readInt16LE([offset]) +### buff.readUInt16BE([offset]) +### buff.readUInt16LE([offset]) +- ```offset``` *{number}* Optional position to start reading data from. **Default**: ```Auto managed offset``` +- Returns *{number}* -## Reading Buffer Values +Read a 16 bit integer value. -### SmartBuffer.readBuffer( length ) -> `Number` **Length of data to read into a Buffer** +### buff.readInt32BE([offset]) +### buff.readInt32LE([offset]) +### buff.readUInt32BE([offset]) +### buff.readUInt32LE([offset]) +- ```offset``` *{number}* Optional position to start reading data from. **Default**: ```Auto managed offset``` +- Returns *{number}* -returns `Buffer` +Read a 32 bit integer value. -> Note: This function uses `slice` to retrieve the Buffer. +### buff.writeInt8(value[, offset]) +### buff.writeUInt8(value[, offset]) +- ```value``` *{number}* The value to write. +- ```offset``` *{number}* An optional offset to write this value to. **Default:** ```Auto managed offset``` +- Returns *{this}* -### SmartBuffer.readBufferNT() +Write a Int8 value. -returns `Buffer` +### buff.insertInt8(value, offset) +### buff.insertUInt8(value, offset) +- ```value``` *{number}* The value to insert. +- ```offset``` *{number}* The offset to insert this data at. +- Returns *{this}* -> 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. +Insert a Int8 value. -## Writing Data +### buff.writeInt16BE(value[, offset]) +### buff.writeInt16LE(value[, offset]) +### buff.writeUInt16BE(value[, offset]) +### buff.writeUInt16LE(value[, offset]) +- ```value``` *{number}* The value to write. +- ```offset``` *{number}* An optional offset to write this value to. **Default:** ```Auto managed offset``` +- Returns *{this}* -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. +Write a 16 bit integer value. +### buff.insertInt16BE(value, offset) +### buff.insertInt16LE(value, offset) +### buff.insertUInt16BE(value, offset) +### buff.insertUInt16LE(value, offset) +- ```value``` *{number}* The value to insert. +- ```offset``` *{number}* The offset to insert this data at. +- Returns *{this}* -## Writing Numeric Values +Insert a 16 bit integer value. -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) +### buff.writeInt32BE(value[, offset]) +### buff.writeInt32LE(value[, offset]) +### buff.writeUInt32BE(value[, offset]) +### buff.writeUInt32LE(value[, offset]) +- ```value``` *{number}* The value to write. +- ```offset``` *{number}* An optional offset to write this value to. **Default:** ```Auto managed offset``` +- Returns *{this}* -Supported Operations: -* writeInt8 -* writeInt16BE -* writeInt16LE -* writeInt32BE -* writeInt32LE -* writeUInt8 -* writeUInt16BE -* writeUInt16LE -* writeUInt32BE -* writeUInt32LE -* writeFloatBE -* writeFloatLE -* writeDoubleBE -* writeDoubleLE +Write a 32 bit integer value. -The following signature is the same for all the above functions: +### buff.insertInt32BE(value, offset) +### buff.insertInt32LE(value, offset) +### buff.insertUInt32BE(value, offset) +### buff.nsertUInt32LE(value, offset) +- ```value``` *{number}* The value to insert. +- ```offset``` *{number}* The offset to insert this data at. +- Returns *{this}* -### SmartBuffer.writeInt8( value, [offset] ) -> `Number` **A valid Int8 number** +Insert a 32 bit integer value. -> `Number` **The position to insert this value at** -returns this +## Floating Point Numbers -> Note: All write operations return `this` to allow for chaining. +### buff.readFloatBE([offset]) +### buff.readFloatLE([offset]) +- ```offset``` *{number}* Optional position to start reading data from. **Default**: ```Auto managed offset``` +- Returns *{number}* -## Writing String Values +Read a Float value. -When reading String values, you can either choose to write a null terminated string, or a non null terminated string. +### buff.eadDoubleBE([offset]) +### buff.readDoubleLE([offset]) +- ```offset``` *{number}* Optional position to start reading data from. **Default**: ```Auto managed offset``` +- Returns *{number}* -### SmartBuffer.writeStringNT( value, [offset], [encoding] ) -### SmartBuffer.writeStringNT( value, [offset] ) -### SmartBuffer.writeStringNT( value, [encoding] ) -> `String` **String value to write** +Read a Double value. -> `Number` **The position to insert this String at** -> `String` **The String encoding to use.** - Defaults to the encoding set in the constructor, or utf8. +### buff.writeFloatBE(value[, offset]) +### buff.writeFloatLE(value[, offset]) +- ```value``` *{number}* The value to write. +- ```offset``` *{number}* An optional offset to write this value to. **Default:** ```Auto managed offset``` +- Returns *{this}* -returns this +Write a Float value. -### SmartBuffer.writeString( value, [offset], [encoding] ) -### SmartBuffer.writeString( value, [offset] ) -### SmartBuffer.writeString( value, [encoding] ) -> `String` **String value to write** +### buff.insertFloatBE(value, offset) +### buff.insertFloatLE(value, offset) +- ```value``` *{number}* The value to insert. +- ```offset``` *{number}* The offset to insert this data at. +- Returns *{this}* -> `Number` **The position to insert this String at** +Insert a Float value. -> `String` **The String encoding to use** - Defaults to the encoding set in the constructor, or utf8. -returns this +### buff.writeDoubleBE(value[, offset]) +### buff.writeDoubleLE(value[, offset]) +- ```value``` *{number}* The value to write. +- ```offset``` *{number}* An optional offset to write this value to. **Default:** ```Auto managed offset``` +- Returns *{this}* +Write a Double value. -## Writing Buffer Values +### buff.insertDoubleBE(value, offset) +### buff.insertDoubleLE(value, offset) +- ```value``` *{number}* The value to insert. +- ```offset``` *{number}* The offset to insert this data at. +- Returns *{this}* -### SmartBuffer.writeBuffer( value, [offset] ) -> `Buffer` **Buffer value to write** +Insert a Double value. -> `Number` **The position to insert this Buffer's content at** +## Strings -returns this +### buff.readString() +### buff.readString(size[, encoding]) +### buff.readString(encoding) +- ```size``` *{number}* The number of bytes to read. **Default:** ```Reads to the end of the Buffer.``` +- ```encoding``` *{string}* The string encoding to use. **Default:** ```utf8```. -### SmartBuffer.writeBufferNT( value, [offset] ) -> `Buffer` **Buffer value to write** +Read a string value. -> `Number` **The position to insert this Buffer's content at** +Examples: +```javascript +const buff = SmartBuffer.fromBuffer(Buffer.from('hello there', 'utf8')); +buff.readString(); // 'hello there' +buff.readString(2); // 'he' +buff.readString(2, 'utf8'); // 'he' +buff.readString('utf8'); // 'hello there' +``` -returns this +### buff.writeString(value) +### buff.writeString(value[, offset]) +### buff.writeString(value[, encoding]) +### buff.writeString(value[, offset[, encoding]]) +- ```value``` *{string}* The string value to write. +- ```offset``` *{number}* The offset to write this value to. **Default:** ```Auto managed offset``` +- ```encoding``` *{string}* An optional string encoding to use. **Default:** ```utf8``` +Write a string value. -## Utility Functions +Examples: +```javascript +buff.writeString('hello'); // Auto managed offset +buff.writeString('hello', 2); +buff.writeString('hello', 'utf8') // Auto managed offset +buff.writeString('hello', 2, 'utf8'); +``` -### SmartBuffer.clear() -Resets the SmartBuffer to its default state where it can be reused for reading or writing. +### buff.insertString(value, offset[, encoding]) +- ```value``` *{string}* The string value to write. +- ```offset``` *{number}* The offset to write this value to. +- ```encoding``` *{string}* An optional string encoding to use. **Default:** ```utf8``` -### SmartBuffer.remaining() +Insert a string value. -returns `Number` The amount of data left to read based on the current read Position. +Examples: +```javascript +buff.insertString('hello', 2); +buff.insertString('hello', 2, 'utf8'); +``` -### SmartBuffer.skip( value ) -> `Number` **The amount of bytes to skip ahead** +## Null Terminated Strings -Skips the read position ahead by the given value. +### buff.readStringNT() +### buff.readStringNT(encoding) +- ```encoding``` *{string}* The string encoding to use. **Default:** ```utf8```. -returns this +Read a null terminated string value. (If a null is not found, it will read to the end of the Buffer). -### SmartBuffer.rewind( value ) -> `Number` **The amount of bytes to reward backwards** +Examples: +```javascript +const buff = SmartBuffer.fromBuffer(Buffer.from('hello\0 there', 'utf8')); +buff.readStringNT(); // 'hello' -Rewinds the read position backwards by the given value. +// If we called this again: +buff.readStringNT(); // ' there' +``` -returns this +### buff.writeStringNT(value) +### buff.writeStringNT(value[, offset]) +### buff.writeStringNT(value[, encoding]) +### buff.writeStringNT(value[, offset[, encoding]]) +- ```value``` *{string}* The string value to write. +- ```offset``` *{number}* The offset to write this value to. **Default:** ```Auto managed offset``` +- ```encoding``` *{string}* An optional string encoding to use. **Default:** ```utf8``` -### SmartBuffer.skipTo( position ) -> `Number` **The point to skip the read position to** +Write a null terminated string value. -Moves the read position to the given point. -returns this +Examples: +```javascript +buff.writeStringNT('hello'); // Auto managed offset <Buffer 68 65 6c 6c 6f 00> +buff.writeStringNT('hello', 2); // <Buffer 00 00 68 65 6c 6c 6f 00> +buff.writeStringNT('hello', 'utf8') // Auto managed offset +buff.writeStringNT('hello', 2, 'utf8'); +``` -### SmartBuffer.toBuffer() +### buff.insertStringNT(value, offset[, encoding]) +- ```value``` *{string}* The string value to write. +- ```offset``` *{number}* The offset to write this value to. +- ```encoding``` *{string}* An optional string encoding to use. **Default:** ```utf8``` -returns `Buffer` A Buffer containing the contents of the internal Buffer. +Insert a null terminated string value. -> Note: This uses the slice function. +Examples: +```javascript +buff.insertStringNT('hello', 2); +buff.insertStringNT('hello', 2, 'utf8'); +``` + +## Buffers + +### buff.readBuffer([length]) +- ```length``` *{number}* The number of bytes to read into a Buffer. **Default:** ```Reads to the end of the Buffer``` + +Read a Buffer of a specified size. + +### buff.writeBuffer(value[, offset]) +- ```value``` *{Buffer}* The buffer value to write. +- ```offset``` *{number}* An optional offset to write the value to. **Default:** ```Auto managed offset``` + +### buff.insertBuffer(value, offset) +- ```value``` *{Buffer}* The buffer value to write. +- ```offset``` *{number}* The offset to write the value to. + + +### buff.readBufferNT() + +Read a null terminated Buffer. + +### buff.writeBufferNT(value[, offset]) +- ```value``` *{Buffer}* The buffer value to write. +- ```offset``` *{number}* An optional offset to write the value to. **Default:** ```Auto managed offset``` + +Write a null terminated Buffer. + + +### buff.insertBufferNT(value, offset) +- ```value``` *{Buffer}* The buffer value to write. +- ```offset``` *{number}* The offset to write the value to. + +Insert a null terminated Buffer. + + +## Offsets + +### buff.readOffset +### buff.readOffset(offset) +- ```offset``` *{number}* The new read offset value to set. +- Returns: ```The current read offset``` + +Gets or sets the current read offset. + +Examples: +```javascript +const currentOffset = buff.readOffset; // 5 + +buff.readOffset = 10; + +console.log(buff.readOffset) // 10 +``` + +### buff.writeOffset +### buff.writeOffset(offset) +- ```offset``` *{number}* The new write offset value to set. +- Returns: ```The current write offset``` + +Gets or sets the current write offset. + +Examples: +```javascript +const currentOffset = buff.writeOffset; // 5 + +buff.writeOffset = 10; + +console.log(buff.writeOffset) // 10 +``` + +### buff.encoding +### buff.encoding(encoding) +- ```encoding``` *{string}* The new string encoding to set. +- Returns: ```The current string encoding``` + +Gets or sets the current string encoding. + +Examples: +```javascript +const currentEncoding = buff.encoding; // 'utf8' + +buff.encoding = 'ascii'; + +console.log(buff.encoding) // 'ascii' +``` + +## Other + +### buff.clear() -### SmartBuffer.toString( [encoding] ) -> `String` **The String encoding to use** - Defaults to the encoding set in the constructor, or utf8. +Clear and resets the SmartBuffer instance. + +### buff.remaining() +- Returns ```Remaining data left to be read``` + +Gets the number of remaining bytes to be read. + + +### buff.internalBuffer +- Returns: *{Buffer}* + +Gets the internally managed Buffer (Includes unmanaged data). + +Examples: +```javascript +const buff = SmartBuffer.fromSize(16); +buff.writeString('hello'); +console.log(buff.InternalBuffer); // <Buffer 68 65 6c 6c 6f 00 00 00 00 00 00 00 00 00 00 00> +``` + +### buff.toBuffer() +- Returns: *{Buffer}* + +Gets a sliced Buffer instance of the internally managed Buffer. (Only includes managed data) + +Examples: +```javascript +const buff = SmartBuffer.fromSize(16); +buff.writeString('hello'); +console.log(buff.toBuffer()); // <Buffer 68 65 6c 6c 6f> +``` -returns `String` The internal Buffer in String representation. +### buff.toString([encoding]) +- ```encoding``` *{string}* The string encoding to use when converting to a string. **Default:** ```utf8``` +- Returns *{string}* -### SmartBuffer.destroy() -Attempts to destroy the smart-buffer. +Gets a string representation of all data in the SmartBuffer. -returns this +### buff.destroy() -## Properties +Destroys the SmartBuffer instance. -### 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 diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js index ef53b9fd4..3e1b95f30 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js @@ -1,98 +1,67 @@ "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("./utils"); // 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) { + * Creates a new SmartBuffer instance. + * + * @param options { SmartBufferOptions } The SmartBufferOptions to apply to this instance. + */ + constructor(options) { 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)) { + this._encoding = DEFAULT_SMARTBUFFER_ENCODING; + this._writeOffset = 0; + this._readOffset = 0; + if (SmartBuffer.isSmartBufferOptions(options)) { // 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.'); - } + if (options.encoding) { + utils_1.checkEncoding(options.encoding); + this._encoding = options.encoding; } // 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); + if (options.size) { + if (utils_1.isFiniteInteger(options.size) && options.size > 0) { + this._buff = Buffer.allocUnsafe(options.size); } else { - throw new Error('Invalid size provided. Size must be a valid integer greater than zero.'); + throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_SIZE); } + // Check for initial Buffer } - else if (arg1.buff) { - if (arg1.buff instanceof Buffer) { - this.buff = arg1.buff; - this.length = arg1.buff.length; + else if (options.buff) { + if (options.buff instanceof Buffer) { + this._buff = options.buff; + this.length = options.buff.length; } else { - throw new Error('Invalid buffer provided in SmartBufferOptions.'); + throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_BUFFER); } } else { - this.buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE); + 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.'); + // If something was passed but it's not a SmartBufferOptions object + if (typeof options !== 'undefined') { + throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_OBJECT); } + // Otherwise default to sane options + this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE); } } /** - * 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 } - */ + * 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, @@ -100,13 +69,13 @@ class SmartBuffer { }); } /** - * 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 } - */ + * 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, @@ -114,613 +83,1013 @@ class SmartBuffer { }); } /** - * Creates a new SmartBuffer instance with the provided SmartBufferOptions options. - * - * @param options { SmartBufferOptions } The options to use when creating the SmartBuffer instance. - */ + * 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); + * 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); } + // Signed integers /** - * 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 an Int8 value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt8(offset) { + return this._readNumberValue(Buffer.prototype.readInt8, 1, offset); } /** - * 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; + * Reads an Int16BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt16BE(offset) { + return this._readNumberValue(Buffer.prototype.readInt16BE, 2, offset); } /** - * 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; + * Reads an Int16LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt16LE(offset) { + return this._readNumberValue(Buffer.prototype.readInt16LE, 2, offset); + } + /** + * Reads an Int32BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt32BE(offset) { + return this._readNumberValue(Buffer.prototype.readInt32BE, 4, offset); } - // 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 - */ + * Reads an Int32LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt32LE(offset) { + return this._readNumberValue(Buffer.prototype.readInt32LE, 4, offset); + } + /** + * 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); + this._writeNumberValue(Buffer.prototype.writeInt8, 1, value, offset); + return this; + } + /** + * Inserts an Int8 value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt8(value, offset) { + this._insertNumberValue(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 - */ + * 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); + this._writeNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset); + return this; + } + /** + * Inserts an Int16BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt16BE(value, offset) { + this._insertNumberValue(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 - */ + * 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); + 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 - */ + * Inserts an Int16LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt16LE(value, offset) { + this._insertNumberValue(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); + 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 - */ + * Inserts an Int32BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt32BE(value, offset) { + this._insertNumberValue(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); + this._writeNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset); + return this; + } + /** + * Inserts an Int32LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt32LE(value, offset) { + this._insertNumberValue(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 - */ + * Reads an UInt8 value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt8(offset) { + return this._readNumberValue(Buffer.prototype.readUInt8, 1, offset); + } + /** + * Reads an UInt16BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt16BE(offset) { + return this._readNumberValue(Buffer.prototype.readUInt16BE, 2, offset); + } + /** + * Reads an UInt16LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt16LE(offset) { + return this._readNumberValue(Buffer.prototype.readUInt16LE, 2, offset); + } + /** + * Reads an UInt32BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt32BE(offset) { + return this._readNumberValue(Buffer.prototype.readUInt32BE, 4, offset); + } + /** + * Reads an UInt32LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt32LE(offset) { + return this._readNumberValue(Buffer.prototype.readUInt32LE, 4, offset); + } + /** + * 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); + this._writeNumberValue(Buffer.prototype.writeUInt8, 1, value, offset); + return this; + } + /** + * Inserts an UInt8 value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt8(value, offset) { + this._insertNumberValue(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 - */ + * 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); + 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 - */ + * Inserts an UInt16BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt16BE(value, offset) { + this._insertNumberValue(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); + 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 - */ + * Inserts an UInt16LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt16LE(value, offset) { + this._insertNumberValue(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); + 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 - */ + * Inserts an UInt32BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt32BE(value, offset) { + this._insertNumberValue(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); + this._writeNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset); + return this; + } + /** + * Inserts an UInt32LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt32LE(value, offset) { + this._insertNumberValue(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 - */ + * Reads an FloatBE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readFloatBE(offset) { + return this._readNumberValue(Buffer.prototype.readFloatBE, 4, offset); + } + /** + * Reads an FloatLE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readFloatLE(offset) { + return this._readNumberValue(Buffer.prototype.readFloatLE, 4, offset); + } + /** + * 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); + 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 - */ + * Inserts a FloatBE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertFloatBE(value, offset) { + this._insertNumberValue(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); + this._writeNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset); + return this; + } + /** + * Inserts a FloatLE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertFloatLE(value, offset) { + this._insertNumberValue(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 - */ + * Reads an DoublEBE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readDoubleBE(offset) { + return this._readNumberValue(Buffer.prototype.readDoubleBE, 8, offset); + } + /** + * Reads an DoubleLE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readDoubleLE(offset) { + return this._readNumberValue(Buffer.prototype.readDoubleLE, 8, offset); + } + /** + * 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); + this._writeNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset); + return this; + } + /** + * Inserts a DoubleBE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertDoubleBE(value, offset) { + this._insertNumberValue(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 - */ + * 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); + 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; + * Inserts a DoubleLE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertDoubleLE(value, offset) { + this._insertNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset); + return this; } + // Strings /** - * 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; + * Reads a String from the current read position. + * + * @param arg1 { Number | String } The number of bytes to read as a String, or the BufferEncoding to use for + * the string (Defaults to instance level encoding). + * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding). + * + * @return { String } + */ + readString(arg1, encoding) { + let lengthVal; + // Length provided + if (typeof arg1 === 'number') { + utils_1.checkLengthValue(arg1); + lengthVal = Math.min(arg1, this.length - this._readOffset); } - 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.'); - } + else { + encoding = arg1; + lengthVal = this.length - this._readOffset; } - // 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.'); - } + // Check encoding + if (typeof encoding !== 'undefined') { + utils_1.checkEncoding(encoding); } - // 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; + const value = this._buff.slice(this._readOffset, this._readOffset + lengthVal).toString(encoding || this._encoding); + this._readOffset += lengthVal; + return value; + } + /** + * Inserts a String + * + * @param value { String } The String value to insert. + * @param offset { Number } The offset to insert the string at. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + */ + insertString(value, offset, encoding) { + utils_1.checkOffsetValue(offset); + return this._handleString(value, true, offset, encoding); + } + /** + * Writes a String + * + * @param value { String } The String value to write. + * @param arg2 { Number | String } The offset to write the string at, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + */ + writeString(value, arg2, encoding) { + return this._handleString(value, false, arg2, encoding); } /** - * 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 } - */ + * 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) { + if (typeof encoding !== 'undefined') { + utils_1.checkEncoding(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) { + 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); + const value = this._buff.slice(this._readOffset, nullPos); // Increment internal Buffer read offset - this.readOffset = nullPos + 1; - return value.toString(encoding || this.encoding); + this._readOffset = nullPos + 1; + return value.toString(encoding || this._encoding); + } + /** + * Inserts a null-terminated String. + * + * @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). + */ + insertStringNT(value, offset, encoding) { + utils_1.checkOffsetValue(offset); + // Write Values + this.insertString(value, offset, encoding); + this.insertUInt8(0x00, offset + value.length); } /** - * 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) { + * Writes a null-terminated String. + * + * @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, arg2, encoding) { // Write Values - this.writeString(value, offset, encoding); - this.writeUInt8(0x00, (typeof offset === 'number' ? offset + value.length : this.writeOffset)); + this.writeString(value, arg2, encoding); + this.writeUInt8(0x00, typeof arg2 === 'number' ? arg2 + 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 } - */ + * Reads a Buffer from the internal read position. + * + * @param length { Number } The length of data to read as a Buffer. + * + * @return { Buffer } + */ readBuffer(length) { + if (typeof length !== 'undefined') { + utils_1.checkLengthValue(length); + } const lengthVal = typeof length === 'number' ? length : this.length; - const endPoint = Math.min(this.length, this.readOffset + lengthVal); + const endPoint = Math.min(this.length, this._readOffset + lengthVal); // Read buffer value - const value = this.buff.slice(this.readOffset, endPoint); + const value = this._buff.slice(this._readOffset, endPoint); // Increment internal Buffer read offset - this.readOffset = endPoint; + 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. - */ + * 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. + */ + insertBuffer(value, offset) { + utils_1.checkOffsetValue(offset); + return this._handleBuffer(value, true, offset); + } + /** + * 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; + return this._handleBuffer(value, false, offset); } /** - * Reads a null-terminated Buffer from the current read poisiton. - * - * @return { Buffer } - */ + * 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) { + 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); + const value = this._buff.slice(this._readOffset, nullPos); // Increment internal Buffer read offset - this.readOffset = nullPos + 1; + 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. - */ + * Inserts a null-terminated Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + */ + insertBufferNT(value, offset) { + utils_1.checkOffsetValue(offset); + // Write Values + this.insertBuffer(value, offset); + this.insertUInt8(0x00, offset + value.length); + return this; + } + /** + * Writes a null-terminated Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + */ writeBufferNT(value, offset) { + // Checks for valid numberic value; + if (typeof offset !== 'undefined') { + utils_1.checkOffsetValue(offset); + } // Write Values this.writeBuffer(value, offset); - this.writeUInt8(0, (typeof offset === 'number' ? offset + value.length : this.writeOffset)); + this.writeUInt8(0x00, typeof offset === 'number' ? offset + value.length : this._writeOffset); return this; } /** - * Clears the SmartBuffer instance to its original empty state. - */ + * Clears the SmartBuffer instance to its original empty state. + */ clear() { - this.writeOffset = 0; - this.readOffset = 0; + this._writeOffset = 0; + this._readOffset = 0; this.length = 0; + return this; } /** - * Gets the remaining data left to be read from the SmartBuffer instance. - * - * @return { Number } - */ + * Gets the remaining data left to be read from the SmartBuffer instance. + * + * @return { Number } + */ remaining() { - return this.length - this.readOffset; + 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; + * Gets the current read offset value of the SmartBuffer instance. + * + * @return { Number } + */ + get readOffset() { + return this._readOffset; } /** - * 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; + * Sets the read offset value of the SmartBuffer instance. + * + * @param offset { Number } - The offset value to set. + */ + set readOffset(offset) { + utils_1.checkOffsetValue(offset); + // Check for bounds. + utils_1.checkTargetOffset(offset, this); + this._readOffset = offset; } /** - * Moves the read offset to a specific position. - * - * @param position { Number } The position to move the read offset to. - */ - skipTo(position) { - this.moveTo(position); + * Gets the current write offset value of the SmartBuffer instance. + * + * @return { Number } + */ + get writeOffset() { + return this._writeOffset; } /** - * 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; + * Sets the write offset value of the SmartBuffer instance. + * + * @param offset { Number } - The offset value to set. + */ + set writeOffset(offset) { + utils_1.checkOffsetValue(offset); + // Check for bounds. + utils_1.checkTargetOffset(offset, this); + this._writeOffset = offset; + } + /** + * Gets the currently set string encoding of the SmartBuffer instance. + * + * @return { BufferEncoding } The string Buffer encoding currently set. + */ + get encoding() { + return this._encoding; } /** - * Gets the value of the internal managed Buffer - * - * @param { Buffer } - */ + * Sets the string encoding of the SmartBuffer instance. + * + * @param encoding { BufferEncoding } The string Buffer encoding to set. + */ + set encoding(encoding) { + utils_1.checkEncoding(encoding); + this._encoding = encoding; + } + /** + * Gets the underlying internal Buffer. (This includes unmanaged data in the Buffer) + * + * @return { Buffer } The Buffer value. + */ + get internalBuffer() { + return this._buff; + } + /** + * Gets the value of the internal managed Buffer (Includes managed data only) + * + * @param { Buffer } + */ toBuffer() { - return this.buff.slice(0, this.length); + 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). - */ + * 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); + const encodingVal = typeof encoding === 'string' ? encoding : this._encoding; + // Check for invalid encoding. + utils_1.checkEncoding(encodingVal); + return this._buff.toString(encodingVal, 0, this.length); + } + /** + * Destroys the SmartBuffer instance. + */ + destroy() { + this.clear(); + return this; + } + /** + * Handles inserting and writing strings. + * + * @param value { String } The String value to insert. + * @param isInsert { Boolean } True if inserting a string, false if writing. + * @param arg2 { Number | String } The offset to insert the string at, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + */ + _handleString(value, isInsert, arg3, encoding) { + let offsetVal = this._writeOffset; + let encodingVal = this._encoding; + // Check for offset + if (typeof arg3 === 'number') { + offsetVal = arg3; + // Check for encoding + } + else if (typeof arg3 === 'string') { + utils_1.checkEncoding(arg3); + encodingVal = arg3; + } + // Check for encoding (third param) + if (typeof encoding === 'string') { + utils_1.checkEncoding(encoding); + encodingVal = encoding; + } + // Calculate bytelength of string. + const byteLength = Buffer.byteLength(value, encodingVal); + // Ensure there is enough internal Buffer capacity. + if (isInsert) { + this.ensureInsertable(byteLength, offsetVal); + } + else { + this._ensureWriteable(byteLength, offsetVal); + } + // Write value + this._buff.write(value, offsetVal, byteLength, encodingVal); + // Increment internal Buffer write offset; + if (isInsert) { + this._writeOffset += byteLength; + } + else { + // If an offset was given, check to see if we wrote beyond the current writeOffset. + if (typeof arg3 === 'number') { + this._writeOffset = Math.max(this._writeOffset, offsetVal + byteLength); + } + else { + // If no offset was given, we wrote to the end of the SmartBuffer so increment writeOffset. + this._writeOffset += byteLength; + } + } + return this; + } + /** + * Handles writing or insert of a Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + */ + _handleBuffer(value, isInsert, offset) { + const offsetVal = typeof offset === 'number' ? offset : this._writeOffset; + // Ensure there is enough internal Buffer capacity. + if (isInsert) { + this.ensureInsertable(value.length, offsetVal); } else { - throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.'); + this._ensureWriteable(value.length, offsetVal); + } + // Write buffer value + value.copy(this._buff, offsetVal); + // Increment internal Buffer write offset; + if (isInsert) { + this._writeOffset += value.length; + } + else { + // If an offset was given, check to see if we wrote beyond the current writeOffset. + if (typeof offset === 'number') { + this._writeOffset = Math.max(this._writeOffset, offsetVal + value.length); + } + else { + // If no offset was given, we wrote to the end of the SmartBuffer so increment writeOffset. + this._writeOffset += value.length; + } } + return this; } /** - * Destroys the SmartBuffer instance. - */ - destroy() { - this.clear(); + * Ensures that the internal Buffer is large enough to read data. + * + * @param length { Number } The length of the data that needs to be read. + * @param offset { Number } The offset of the data that needs to be read. + */ + ensureReadable(length, offset) { + // Offset value defaults to managed read offset. + let offsetVal = this._readOffset; + // If an offset was provided, use it. + if (typeof offset !== 'undefined') { + // Checks for valid numberic value; + utils_1.checkOffsetValue(offset); + // Overide with custom offset. + offsetVal = offset; + } + // Checks if offset is below zero, or the offset+length offset is beyond the total length of the managed data. + if (offsetVal < 0 || offsetVal + length > this.length) { + throw new Error(utils_1.ERRORS.INVALID_READ_BEYOND_BOUNDS); + } } /** - * 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); + * Ensures that the internal Buffer is large enough to insert data. + * + * @param dataLength { Number } The length of the data that needs to be written. + * @param offset { Number } The offset of the data to be written. + */ + ensureInsertable(dataLength, offset) { + // Checks for valid numberic value; + utils_1.checkOffsetValue(offset); + // Ensure there is enough internal Buffer capacity. + this._ensureCapacity(this.length + dataLength); + // If an offset was provided and its not the very end of the buffer, copy data into appropriate location in regards to the offset. + if (offset < this.length) { + this._buff.copy(this._buff, offset + dataLength, offset, this._buff.length); + } + // Adjust tracked smart buffer length + if (offset + dataLength > this.length) { + this.length = offset + dataLength; + } + else { + this.length += dataLength; + } + } + /** + * Ensures that the internal Buffer is large enough to write data. + * + * @param dataLength { Number } The length of the data that needs to be written. + * @param offset { Number } The offset of the data to be written (defaults to writeOffset). + */ + _ensureWriteable(dataLength, offset) { + const offsetVal = typeof offset === 'number' ? offset : this._writeOffset; + // Ensure enough capacity to write data. + this._ensureCapacity(offsetVal + dataLength); + // Adjust SmartBuffer length (if offset + length is larger than managed length, adjust length) + if (offsetVal + dataLength > this.length) { + this.length = offsetVal + dataLength; + } + } + /** + * 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 offset { Number } The offset to read from (optional). When this is not provided, the managed readOffset is used instead. + * + * @param { Number } + */ + _readNumberValue(func, byteSize, offset) { + this.ensureReadable(byteSize, offset); + // Call Buffer.readXXXX(); + const value = func.call(this._buff, typeof offset === 'number' ? offset : this._readOffset); + // Adjust internal read offset if an optional read offset was not provided. + if (typeof offset === 'undefined') { + this._readOffset += byteSize; + } + return value; + } + /** + * Inserts a numeric number value based on the given offset and value. + * + * @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 (REQUIRED). + * + */ + _insertNumberValue(func, byteSize, value, offset) { + // Check for invalid offset values. + utils_1.checkOffsetValue(offset); + // Ensure there is enough internal Buffer capacity. (raw offset is passed) + this.ensureInsertable(byteSize, offset); + // Call buffer.writeXXXX(); + func.call(this._buff, value, offset); + // Adjusts internally managed write offset. + this._writeOffset += byteSize; + } + /** + * Writes a numeric number value based on the given offset and value. + * + * @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 (REQUIRED). + * + */ + _writeNumberValue(func, byteSize, value, offset) { + // If an offset was provided, validate it. + if (typeof offset === 'number') { + // Check if we're writing beyond the bounds of the managed data. + if (offset < 0) { + throw new Error(utils_1.ERRORS.INVALID_WRITE_BEYOND_BOUNDS); + } + utils_1.checkOffsetValue(offset); + } + // Default to writeOffset if no offset value was given. + const offsetVal = typeof offset === 'number' ? offset : this._writeOffset; + // Ensure there is enough internal Buffer capacity. (raw offset is passed) + this._ensureWriteable(byteSize, offsetVal); + func.call(this._buff, value, offsetVal); + // If an offset was given, check to see if we wrote beyond the current writeOffset. + if (typeof offset === 'number') { + this._writeOffset = Math.max(this._writeOffset, offsetVal + byteSize); + } + else { + // If no numeric offset was given, we wrote to the end of the SmartBuffer so increment writeOffset. + this._writeOffset += byteSize; + } } } -module.exports = SmartBuffer; +exports.SmartBuffer = SmartBuffer; //# sourceMappingURL=smartbuffer.js.map
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js.map b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js.map index 60af067a2..4a1efcd05 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js.map +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js.map @@ -1 +1 @@ -{"version":3,"file":"smartbuffer.js","sourceRoot":"","sources":["../src/smartbuffer.ts"],"names":[],"mappings":";AAaA,kDAAkD;AAClD,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAEtC,mEAAmE;AACnE,MAAM,4BAA4B,GAAG,MAAM,CAAC;AAE5C;IASI;;;;;OAKG;IACH,YAAY,IAA4D,EAAE,IAAqB;QAbxF,WAAM,GAAW,CAAC,CAAC;QACnB,aAAQ,GAAmB,4BAA4B,CAAC;QAEvD,gBAAW,GAAW,CAAC,CAAC;QACxB,eAAU,GAAW,CAAC,CAAC;QAW3B,+BAA+B;QAC/B,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC;YAE3B,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;gBAC9D,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACzC,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;YAC9F,CAAC;QAEL,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC;YAClC,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAC1B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;gBACzD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACzB,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,MAAM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E,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,cAAM,CAAC,2BAA2B,CAAC,CAAC;YACtD,CAAC;YAED,wBAAgB,CAAC,MAAM,CAAC,CAAC;QAC3B,CAAC;QAED,uDAAuD;QACvD,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;QAE1E,0EAA0E;QAC1E,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAE3C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAExC,mFAAmF;QACnF,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC;YAC/B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAC;QACxE,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,mGAAmG;YACnG,IAAI,CAAC,YAAY,IAAI,QAAQ,CAAC;QAChC,CAAC;IACH,CAAC;CACF;AAE4B,kCAAW"}
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/utils.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/utils.js new file mode 100644 index 000000000..76b330cd9 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/utils.js @@ -0,0 +1,95 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Error strings + */ +const ERRORS = { + INVALID_ENCODING: 'Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.', + INVALID_SMARTBUFFER_SIZE: 'Invalid size provided. Size must be a valid integer greater than zero.', + INVALID_SMARTBUFFER_BUFFER: 'Invalid Buffer provided in SmartBufferOptions.', + INVALID_SMARTBUFFER_OBJECT: 'Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.', + INVALID_OFFSET: 'An invalid offset value was provided.', + INVALID_OFFSET_NON_NUMBER: 'An invalid offset value was provided. A numeric value is required.', + INVALID_LENGTH: 'An invalid length value was provided.', + INVALID_LENGTH_NON_NUMBER: 'An invalid length value was provived. A numeric value is required.', + INVALID_TARGET_OFFSET: 'Target offset is beyond the bounds of the internal SmartBuffer data.', + INVALID_TARGET_LENGTH: 'Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.', + INVALID_READ_BEYOND_BOUNDS: 'Attempted to read beyond the bounds of the managed data.', + INVALID_WRITE_BEYOND_BOUNDS: 'Attempted to write beyond the bounds of the managed data.' +}; +exports.ERRORS = ERRORS; +/** + * Checks if a given encoding is a valid Buffer encoding. (Throws an exception if check fails) + * + * @param { String } encoding The encoding string to check. + */ +function checkEncoding(encoding) { + if (!Buffer.isEncoding(encoding)) { + throw new Error(ERRORS.INVALID_ENCODING); + } +} +exports.checkEncoding = checkEncoding; +/** + * Checks if a given number is a finite integer. (Throws an exception if check fails) + * + * @param { Number } value The number value to check. + */ +function isFiniteInteger(value) { + return typeof value === 'number' && isFinite(value) && isInteger(value); +} +exports.isFiniteInteger = isFiniteInteger; +/** + * Checks if an offset/length value is valid. (Throws an exception if check fails) + * + * @param value The value to check. + * @param offset True if checking an offset, false if checking a length. + */ +function checkOffsetOrLengthValue(value, offset) { + if (typeof value === 'number') { + // Check for non finite/non integers + if (!isFiniteInteger(value) || value < 0) { + throw new Error(offset ? ERRORS.INVALID_OFFSET : ERRORS.INVALID_LENGTH); + } + } + else { + throw new Error(offset ? ERRORS.INVALID_OFFSET_NON_NUMBER : ERRORS.INVALID_LENGTH_NON_NUMBER); + } +} +/** + * Checks if a length value is valid. (Throws an exception if check fails) + * + * @param { Number } length The value to check. + */ +function checkLengthValue(length) { + checkOffsetOrLengthValue(length, false); +} +exports.checkLengthValue = checkLengthValue; +/** + * Checks if a offset value is valid. (Throws an exception if check fails) + * + * @param { Number } offset The value to check. + */ +function checkOffsetValue(offset) { + checkOffsetOrLengthValue(offset, true); +} +exports.checkOffsetValue = checkOffsetValue; +/** + * Checks if a target offset value is out of bounds. (Throws an exception if check fails) + * + * @param { Number } offset The offset value to check. + * @param { SmartBuffer } buff The SmartBuffer instance to check against. + */ +function checkTargetOffset(offset, buff) { + if (offset < 0 || offset > buff.length) { + throw new Error(ERRORS.INVALID_TARGET_OFFSET); + } +} +exports.checkTargetOffset = checkTargetOffset; +/** + * Determines whether a given number is a integer. + * @param value The number to check. + */ +function isInteger(value) { + return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; +} +//# sourceMappingURL=utils.js.map
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/utils.js.map b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/utils.js.map new file mode 100644 index 000000000..905148c08 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AAEA;;GAEG;AACH,MAAM,MAAM,GAAG;IACb,gBAAgB,EAAE,kGAAkG;IACpH,wBAAwB,EAAE,wEAAwE;IAClG,0BAA0B,EAAE,gDAAgD;IAC5E,0BAA0B,EAAE,2FAA2F;IACvH,cAAc,EAAE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AAwB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAC1C,CAAC;AA+BkE,4CAAgB;AA7BnF;;;;GAIG;AACH,0BAA0B,MAAW;IACnC,wBAAwB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AAsBgD,4CAAgB;AApBjE;;;;;GAKG;AACH,2BAA2B,MAAc,EAAE,IAAiB;IAC1D,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAChD,CAAC;AACH,CAAC;AAUoF,8CAAiB;AARtG;;;GAGG;AACH,mBAAmB,KAAa;IAC9B,MAAM,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;AACrF,CAAC"}
\ No newline at end of file diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/docs/CHANGELOG.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/docs/CHANGELOG.md new file mode 100644 index 000000000..15c02d50f --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/docs/CHANGELOG.md @@ -0,0 +1,65 @@ +# Change Log +## 4.0 +> Released 10/21/2017 +* Major breaking changes arriving in v4. + +### New Features +* Ability to read data from a specific offset. ex: readInt8(5) +* Ability to write over data when an offset is given (see breaking changes) ex: writeInt8(5, 0); +* Ability to set internal read and write offsets. + + + +### Breaking Changes + +* Old constructor patterns have been completely removed. It's now required to use the SmartBuffer.fromXXX() factory constructors. Read more on the v4 docs. +* rewind(), skip(), moveTo() have been removed. +* Internal private properties are now prefixed with underscores (_). +* **All** writeXXX() methods that are given an offset will now **overwrite data** instead of insert +* insertXXX() methods have been added for when you want to insert data at a specific offset (this replaces the old behavior of writeXXX() when an offset was provided) + + +### Other Changes +* Standardizd error messaging +* Standardized offset/length bounds and sanity checking +* General overall cleanup of code. + +## 3.0.3 +> Released 02/19/2017 +* Adds missing type definitions for some internal functions. + +## 3.0.2 +> Released 02/17/2017 + +### Bug Fixes +* Fixes a bug where using readString with a length of zero resulted in reading the remaining data instead of returning an empty string. (Fixed by Seldszar) + +## 3.0.1 +> Released 02/15/2017 + +### Bug Fixes +* Fixes a bug leftover from the TypeScript refactor where .readIntXXX() resulted in .readUIntXXX() being called by mistake. + +## 3.0 +> Released 02/12/2017 + +### Bug Fixes +* readUIntXXXX() methods will now throw an exception if they attempt to read beyond the bounds of the valid buffer data available. + * **Note** This is technically a breaking change, so version is bumped to 3.x. + +## 2.0 +> Relased 01/30/2017 + +### New Features: + +* Entire package re-written in TypeScript (2.1) +* Backwards compatibility is preserved for now +* New factory methods for creating SmartBuffer instances + * SmartBuffer.fromSize() + * SmartBuffer.fromBuffer() + * SmartBuffer.fromOptions() +* New SmartBufferOptions constructor options +* Added additional tests + +### Bug Fixes: +* Fixes a bug where reading null terminated strings may result in an exception. diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/docs/README_v3.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/docs/README_v3.md new file mode 100644 index 000000000..ae753d7ff --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/docs/README_v3.md @@ -0,0 +1,359 @@ +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. + +![stats](https://nodei.co/npm/smart-buffer.png?downloads=true&downloadRank=true&stars=true "stats") + +### 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. +* Built in TypeScript +* Type Definitions Provided + +Requirements: +* Node v4.0+ is supported at this time. (Versions prior to 2.0 will work on node 0.10) + + +#### 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. + +## Breaking Changes with 2.0 +The latest version (2.0+) is written in TypeScript, and are compiled to ES6 Javascript. This means the earliest Node.js it supports will be 4.x (in strict mode.) If you're using version 6 and above it will work without any issues. From an API standpoint, 2.0 is backwards compatible. The only difference is SmartBuffer is not exported directly as the root module. + +## Breaking Changes with 3.0 +Starting with 3.0, if any of the readIntXXXX() methods are called and the requested data is larger than the bounds of the internally managed valid buffer data, an exception will now be thrown. + +## Installing: + +`npm install smart-buffer` + +or + +`yarn add smart-buffer` + +Note: The published NPM package includes the built javascript library. +If you cloned this repo and wish to build the library manually use: + +`tsc -p ./` + +## 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 +// 1.x (javascript) +var SmartBuffer = require('smart-buffer'); + +// 1.x (typescript) +import SmartBuffer = require('smart-buffer'); + +// 2.x+ (javascript) +const SmartBuffer = require('smart-buffer').SmartBuffer; + +// 2.x+ (typescript) +import { SmartBuffer, SmartBufferOptions} from 'smart-buffer'; + +function createLoginPacket(username, password, age, country) { + let 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 +let 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 + +let reader = SmartBuffer.fromBuffer(login); + +let 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 ways to construct an instance. Starting with version 2.0, the following factory methods are preffered. + +```javascript +let SmartBuffer = require('smart-buffer'); + +// Creating SmartBuffer from existing Buffer +let buff = SmartBuffer.fromBuffer(buffer); // Creates instance from buffer. (Uses default utf8 encoding) +let buff = SmartBuffer.fromBuffer(buffer, 'ascii'); // Creates instance from buffer with ascii encoding for Strings. + +// Creating SmartBuffer with specified internal Buffer size. +let buff = SmartBuffer.fromSize(1024); // Creates instance with internal Buffer size of 1024. +let buff = SmartBuffer.fromSize(1024, 'utf8'); // Creates instance with intenral Buffer size of 1024, and utf8 encoding. + +// Creating SmartBuffer with options object. This one specifies size and encoding. +let buff = SmartBuffer.fromOptions({ + size: 1024, + encoding: 'ascii' +}); + +// Creating SmartBuffer with options object. This one specified an existing Buffer. +let buff = SmartBuffer.fromOptions({ + buff: buffer +}); + +// Just want a regular SmartBuffer with all default options? +let buff = new SmartBuffer(); +``` + +## Backwards Compatibility: + +All constructors used prior to 2.0 still are supported. However it's not recommended to use these. + +```javascript +let writer = new SmartBuffer(); // Defaults to utf8, 4096 length internal Buffer. +let writer = new SmartBuffer(1024); // Defaults to utf8, 1024 length internal Buffer. +let writer = new SmartBuffer('ascii'); // Sets to ascii encoding, 4096 length internal buffer. +let 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 +let reader = new SmartBuffer(somebuffer); +let 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. + +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] ) +### SmartBuffer.readString( [encoding] ) +### SmartBuffer.readString( [length], [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.moveTo( 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. + +## 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/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/docs/ROADMAP.md b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/docs/ROADMAP.md new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/docs/ROADMAP.md diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/lib/smart-buffer.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/lib/smart-buffer.js deleted file mode 100644 index ea69cfc09..000000000 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/lib/smart-buffer.js +++ /dev/null @@ -1,371 +0,0 @@ -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/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/package.json b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/package.json index 8456749a4..5312ad8b9 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/package.json +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/package.json @@ -1,73 +1,114 @@ { - "_args": [ - [ - "smart-buffer@1.1.15", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_from": "smart-buffer@1.1.15", - "_id": "smart-buffer@1.1.15", + "_from": "smart-buffer@^4.0.1", + "_id": "smart-buffer@4.0.1", "_inBundle": false, - "_integrity": "sha1-fxFLW2X6s+KjWqd1uxLw0cZJvxY=", + "_integrity": "sha512-RFqinRVJVcCAL9Uh1oVqE6FZkqsyLiVOYEZ20TqIOjuX7iFVJ+zsbs4RIghnw/pTs7mZvt8ZHhvm1ZUrR4fykg==", "_location": "/libnpmhook/npm-registry-fetch/make-fetch-happen/socks-proxy-agent/socks/smart-buffer", "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "range", "registry": true, - "raw": "smart-buffer@1.1.15", + "raw": "smart-buffer@^4.0.1", "name": "smart-buffer", "escapedName": "smart-buffer", - "rawSpec": "1.1.15", + "rawSpec": "^4.0.1", "saveSpec": null, - "fetchSpec": "1.1.15" + "fetchSpec": "^4.0.1" }, "_requiredBy": [ "/libnpmhook/npm-registry-fetch/make-fetch-happen/socks-proxy-agent/socks" ], - "_resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-1.1.15.tgz", - "_spec": "1.1.15", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.0.1.tgz", + "_shasum": "07ea1ca8d4db24eb4cac86537d7d18995221ace3", + "_spec": "smart-buffer@^4.0.1", + "_where": "/Users/rebecca/code/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks", "author": { "name": "Josh Glazebrook" }, "bugs": { "url": "https://github.com/JoshGlazebrook/smart-buffer/issues" }, + "bundleDependencies": false, "dependencies": {}, - "description": "A smarter Buffer that keeps track of its own read and write positions while growing endlessly.", + "deprecated": false, + "description": "smart-buffer is a Buffer wrapper that adds automatic read & write offset tracking, string operations, data insertions, and more.", "devDependencies": { - "chai": "^3.5.0", - "coveralls": "^2.11.15", - "istanbul": "^0.4.3", - "mocha": "^3.2.0", - "mocha-lcov-reporter": "^1.2.0" + "@types/chai": "4.0.4", + "@types/mocha": "^2.2.44", + "@types/node": "^8.0.51", + "chai": "4.1.2", + "coveralls": "3.0.0", + "istanbul": "^0.4.5", + "mocha": "4.0.1", + "mocha-lcov-reporter": "^1.3.0", + "nyc": "^11.3.0", + "source-map-support": "0.5.0", + "ts-node": "3.3.0", + "tslint": "5.8.0", + "typescript": "2.6.1" }, "engines": { - "node": ">= 0.10.15", - "npm": ">= 1.3.5" + "node": ">= 4.0.0", + "npm": ">= 3.0.0" }, "homepage": "https://github.com/JoshGlazebrook/smart-buffer/", "keywords": [ "buffer", "smart", - "serialize", "packet", + "serialize", "network", "cursor", "simple" ], "license": "MIT", - "main": "lib/smart-buffer.js", + "main": "build/smartbuffer.js", "name": "smart-buffer", + "nyc": { + "extension": [ + ".ts", + ".tsx" + ], + "include": [ + "src/*.ts", + "src/**/*.ts" + ], + "exclude": [ + "**.*.d.ts", + "node_modules", + "typings" + ], + "require": [ + "ts-node/register" + ], + "reporter": [ + "json", + "html" + ], + "all": true + }, "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" + "build": "tsc -p ./", + "coverage": "NODE_ENV=test nyc npm test", + "coveralls": "NODE_ENV=test nyc npm test && nyc report --reporter=text-lcov | coveralls", + "lint": "tslint --type-check --project tsconfig.json 'src/**/*.ts'", + "prepublish": "npm install -g typescript && npm run build", + "test": "NODE_ENV=test mocha --recursive --compilers ts:ts-node/register test/**/*.ts" }, - "typings": "typings/index", - "version": "1.1.15" + "typings": "typings/smartbuffer.d.ts", + "version": "4.0.1", + "warnings": [ + { + "code": "ENOTSUP", + "required": { + "node": ">= 4.0.0", + "npm": ">= 3.0.0" + }, + "pkgid": "smart-buffer@4.0.1" + } + ] } diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/test/smart-buffer.test.js b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/test/smart-buffer.test.js deleted file mode 100644 index 0897d54c2..000000000 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/test/smart-buffer.test.js +++ /dev/null @@ -1,410 +0,0 @@ -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/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/index.d.ts b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/index.d.ts deleted file mode 100644 index b567f1e97..000000000 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/index.d.ts +++ /dev/null @@ -1,383 +0,0 @@ -// 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/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/smartbuffer.d.ts b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/smartbuffer.d.ts new file mode 100644 index 000000000..79fa6306a --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/smartbuffer.d.ts @@ -0,0 +1,654 @@ +/// <reference types="node" /> +declare module 'smart-buffer' { + /** + * Object interface for constructing new SmartBuffer instances. + */ + interface SmartBufferOptions { + encoding?: BufferEncoding; + size?: number; + buff?: Buffer; + } + class SmartBuffer { + length: number; + private _encoding; + private _buff; + private _writeOffset; + private _readOffset; + /** + * Creates a new SmartBuffer instance. + * + * @param options { SmartBufferOptions } The SmartBufferOptions to apply to this instance. + */ + constructor(options?: SmartBufferOptions); + /** + * 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: number, encoding?: BufferEncoding): SmartBuffer; + /** + * 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: Buffer, encoding?: BufferEncoding): SmartBuffer; + /** + * 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: SmartBufferOptions): SmartBuffer; + /** + * Type checking function that determines if an object is a SmartBufferOptions object. + */ + static isSmartBufferOptions( + options: SmartBufferOptions + ): options is SmartBufferOptions; + /** + * Reads an Int8 value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt8(offset?: number): number; + /** + * Reads an Int16BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt16BE(offset?: number): number; + /** + * Reads an Int16LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt16LE(offset?: number): number; + /** + * Reads an Int32BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt32BE(offset?: number): number; + /** + * Reads an Int32LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt32LE(offset?: number): number; + /** + * 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: number, offset?: number): SmartBuffer; + /** + * Inserts an Int8 value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt8(value: number, offset: number): SmartBuffer; + /** + * 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: number, offset?: number): SmartBuffer; + /** + * Inserts an Int16BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt16BE(value: number, offset: number): SmartBuffer; + /** + * 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: number, offset?: number): SmartBuffer; + /** + * Inserts an Int16LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt16LE(value: number, offset: number): SmartBuffer; + /** + * 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: number, offset?: number): SmartBuffer; + /** + * Inserts an Int32BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt32BE(value: number, offset: number): SmartBuffer; + /** + * 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: number, offset?: number): SmartBuffer; + /** + * Inserts an Int32LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt32LE(value: number, offset: number): SmartBuffer; + /** + * Reads an UInt8 value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt8(offset?: number): number; + /** + * Reads an UInt16BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt16BE(offset?: number): number; + /** + * Reads an UInt16LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt16LE(offset?: number): number; + /** + * Reads an UInt32BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt32BE(offset?: number): number; + /** + * Reads an UInt32LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt32LE(offset?: number): number; + /** + * 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: number, offset?: number): SmartBuffer; + /** + * Inserts an UInt8 value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt8(value: number, offset: number): SmartBuffer; + /** + * 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: number, offset?: number): SmartBuffer; + /** + * Inserts an UInt16BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt16BE(value: number, offset: number): SmartBuffer; + /** + * 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: number, offset?: number): SmartBuffer; + /** + * Inserts an UInt16LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt16LE(value: number, offset: number): SmartBuffer; + /** + * 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: number, offset?: number): SmartBuffer; + /** + * Inserts an UInt32BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt32BE(value: number, offset: number): SmartBuffer; + /** + * 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: number, offset?: number): SmartBuffer; + /** + * Inserts an UInt32LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt32LE(value: number, offset: number): SmartBuffer; + /** + * Reads an FloatBE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readFloatBE(offset?: number): number; + /** + * Reads an FloatLE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readFloatLE(offset?: number): number; + /** + * 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: number, offset?: number): SmartBuffer; + /** + * Inserts a FloatBE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertFloatBE(value: number, offset: number): SmartBuffer; + /** + * 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: number, offset?: number): SmartBuffer; + /** + * Inserts a FloatLE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertFloatLE(value: number, offset: number): SmartBuffer; + /** + * Reads an DoublEBE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readDoubleBE(offset?: number): number; + /** + * Reads an DoubleLE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readDoubleLE(offset?: number): number; + /** + * 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: number, offset?: number): SmartBuffer; + /** + * Inserts a DoubleBE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertDoubleBE(value: number, offset: number): SmartBuffer; + /** + * 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: number, offset?: number): SmartBuffer; + /** + * Inserts a DoubleLE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertDoubleLE(value: number, offset: number): SmartBuffer; + /** + * Reads a String from the current read position. + * + * @param arg1 { Number | String } The number of bytes to read as a String, or the BufferEncoding to use for + * the string (Defaults to instance level encoding). + * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding). + * + * @return { String } + */ + readString( + arg1?: number | BufferEncoding, + encoding?: BufferEncoding + ): string; + /** + * Inserts a String + * + * @param value { String } The String value to insert. + * @param offset { Number } The offset to insert the string at. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + */ + insertString( + value: string, + offset: number, + encoding?: BufferEncoding + ): SmartBuffer; + /** + * Writes a String + * + * @param value { String } The String value to write. + * @param arg2 { Number | String } The offset to write the string at, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + */ + writeString( + value: string, + arg2?: number | BufferEncoding, + encoding?: BufferEncoding + ): SmartBuffer; + /** + * 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?: BufferEncoding): string; + /** + * Inserts a null-terminated String. + * + * @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). + */ + insertStringNT( + value: string, + offset: number, + encoding?: BufferEncoding + ): void; + /** + * Writes a null-terminated String. + * + * @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: string, + arg2?: number | BufferEncoding, + encoding?: BufferEncoding + ): void; + /** + * Reads a Buffer from the internal read position. + * + * @param length { Number } The length of data to read as a Buffer. + * + * @return { Buffer } + */ + readBuffer(length?: number): Buffer; + /** + * 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. + */ + insertBuffer(value: Buffer, offset: number): SmartBuffer; + /** + * 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: Buffer, offset?: number): SmartBuffer; + /** + * Reads a null-terminated Buffer from the current read poisiton. + * + * @return { Buffer } + */ + readBufferNT(): Buffer; + /** + * Inserts a null-terminated Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + */ + insertBufferNT(value: Buffer, offset: number): SmartBuffer; + /** + * Writes a null-terminated Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + */ + writeBufferNT(value: Buffer, offset?: number): SmartBuffer; + /** + * Clears the SmartBuffer instance to its original empty state. + */ + clear(): SmartBuffer; + /** + * Gets the remaining data left to be read from the SmartBuffer instance. + * + * @return { Number } + */ + remaining(): number; + /** + * Gets the current read offset value of the SmartBuffer instance. + * + * @return { Number } + */ + /** + * Sets the read offset value of the SmartBuffer instance. + * + * @param offset { Number } - The offset value to set. + */ + readOffset: number; + /** + * Gets the current write offset value of the SmartBuffer instance. + * + * @return { Number } + */ + /** + * Sets the write offset value of the SmartBuffer instance. + * + * @param offset { Number } - The offset value to set. + */ + writeOffset: number; + /** + * Gets the currently set string encoding of the SmartBuffer instance. + * + * @return { BufferEncoding } The string Buffer encoding currently set. + */ + /** + * Sets the string encoding of the SmartBuffer instance. + * + * @param encoding { BufferEncoding } The string Buffer encoding to set. + */ + encoding: BufferEncoding; + /** + * Gets the underlying internal Buffer. (This includes unmanaged data in the Buffer) + * + * @return { Buffer } The Buffer value. + */ + readonly internalBuffer: Buffer; + /** + * Gets the value of the internal managed Buffer (Includes managed data only) + * + * @param { Buffer } + */ + toBuffer(): Buffer; + /** + * 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?: BufferEncoding): string; + /** + * Destroys the SmartBuffer instance. + */ + destroy(): SmartBuffer; + /** + * Handles inserting and writing strings. + * + * @param value { String } The String value to insert. + * @param isInsert { Boolean } True if inserting a string, false if writing. + * @param arg2 { Number | String } The offset to insert the string at, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + */ + private _handleString(value, isInsert, arg3?, encoding?); + /** + * Handles writing or insert of a Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + */ + private _handleBuffer(value, isInsert, offset?); + /** + * Ensures that the internal Buffer is large enough to read data. + * + * @param length { Number } The length of the data that needs to be read. + * @param offset { Number } The offset of the data that needs to be read. + */ + private ensureReadable(length, offset?); + /** + * Ensures that the internal Buffer is large enough to insert data. + * + * @param dataLength { Number } The length of the data that needs to be written. + * @param offset { Number } The offset of the data to be written. + */ + private ensureInsertable(dataLength, offset); + /** + * Ensures that the internal Buffer is large enough to write data. + * + * @param dataLength { Number } The length of the data that needs to be written. + * @param offset { Number } The offset of the data to be written (defaults to writeOffset). + */ + private _ensureWriteable(dataLength, offset?); + /** + * 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. + */ + private _ensureCapacity(minLength); + /** + * 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 offset { Number } The offset to read from (optional). When this is not provided, the managed readOffset is used instead. + * + * @param { Number } + */ + private _readNumberValue(func, byteSize, offset?); + /** + * Inserts a numeric number value based on the given offset and value. + * + * @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 (REQUIRED). + * + */ + private _insertNumberValue(func, byteSize, value, offset); + /** + * Writes a numeric number value based on the given offset and value. + * + * @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 (REQUIRED). + * + */ + private _writeNumberValue(func, byteSize, value, offset?); + } + export { SmartBufferOptions, SmartBuffer }; +} diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/utils.d.ts b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/utils.d.ts new file mode 100644 index 000000000..951b85a5b --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/utils.d.ts @@ -0,0 +1,51 @@ +/// <reference types="node" /> +import { SmartBuffer } from './smartbuffer'; +/** + * Error strings + */ +declare const ERRORS: { + INVALID_ENCODING: string; + INVALID_SMARTBUFFER_SIZE: string; + INVALID_SMARTBUFFER_BUFFER: string; + INVALID_SMARTBUFFER_OBJECT: string; + INVALID_OFFSET: string; + INVALID_OFFSET_NON_NUMBER: string; + INVALID_LENGTH: string; + INVALID_LENGTH_NON_NUMBER: string; + INVALID_TARGET_OFFSET: string; + INVALID_TARGET_LENGTH: string; + INVALID_READ_BEYOND_BOUNDS: string; + INVALID_WRITE_BEYOND_BOUNDS: string; +}; +/** + * Checks if a given encoding is a valid Buffer encoding. (Throws an exception if check fails) + * + * @param { String } encoding The encoding string to check. + */ +declare function checkEncoding(encoding: BufferEncoding): void; +/** + * Checks if a given number is a finite integer. (Throws an exception if check fails) + * + * @param { Number } value The number value to check. + */ +declare function isFiniteInteger(value: number): boolean; +/** + * Checks if a length value is valid. (Throws an exception if check fails) + * + * @param { Number } length The value to check. + */ +declare function checkLengthValue(length: any): void; +/** + * Checks if a offset value is valid. (Throws an exception if check fails) + * + * @param { Number } offset The value to check. + */ +declare function checkOffsetValue(offset: any): void; +/** + * Checks if a target offset value is out of bounds. (Throws an exception if check fails) + * + * @param { Number } offset The offset value to check. + * @param { SmartBuffer } buff The SmartBuffer instance to check against. + */ +declare function checkTargetOffset(offset: number, buff: SmartBuffer): void; +export { ERRORS, isFiniteInteger, checkEncoding, checkOffsetValue, checkLengthValue, checkTargetOffset }; diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/yarn.lock b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/yarn.lock new file mode 100644 index 000000000..567b06f6c --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/yarn.lock @@ -0,0 +1,1849 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/chai@4.0.4": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.0.4.tgz#fe86315d9a66827feeb16f73bc954688ec950e18" + +"@types/mocha@^2.2.44": + version "2.2.44" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.44.tgz#1d4a798e53f35212fd5ad4d04050620171cd5b5e" + +"@types/node@^8.0.51": + version "8.0.51" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.51.tgz#b31d716fb8d58eeb95c068a039b9b6292817d5fb" + +abbrev@1, abbrev@1.0.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" + +ajv@^5.1.0: + version "5.2.3" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.2.3.tgz#c06f598778c44c6b161abafe3466b81ad1814ed2" + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + json-schema-traverse "^0.3.0" + json-stable-stringify "^1.0.1" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" + dependencies: + color-convert "^1.9.0" + +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + dependencies: + default-require-extensions "^1.0.0" + +archy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +arrify@^1.0.0, arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asn1@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assertion-error@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" + +async@1.x, async@^1.4.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + +aws4@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" + +babel-code-frame@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +babel-generator@^6.18.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.1.tgz#e715f486c58ded25649d888944d52aa07c5d9497" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.2.0" + source-map "^0.5.0" + trim-right "^1.0.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-runtime@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.10.0" + +babel-template@^6.16.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babylon "^6.11.0" + lodash "^4.2.0" + +babel-traverse@^6.18.0, babel-traverse@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695" + dependencies: + babel-code-frame "^6.22.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + babylon "^6.15.0" + debug "^2.2.0" + globals "^9.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +babel-types@^6.18.0, babel-types@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975" + dependencies: + babel-runtime "^6.22.0" + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + +babylon@^6.11.0, babylon@^6.15.0, babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + +balanced-match@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" + +bcrypt-pbkdf@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + dependencies: + tweetnacl "^0.14.3" + +boom@4.x.x: + version "4.3.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" + dependencies: + hoek "4.x.x" + +boom@5.x.x: + version "5.2.0" + resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" + dependencies: + hoek "4.x.x" + +brace-expansion@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59" + dependencies: + balanced-match "^0.4.1" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +browser-stdout@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" + +builtin-modules@^1.0.0, builtin-modules@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +caching-transform@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-1.0.1.tgz#6dbdb2f20f8d8fbce79f3e94e9d1742dcdf5c0a1" + dependencies: + md5-hex "^1.2.0" + mkdirp "^0.5.1" + write-file-atomic "^1.1.4" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chai@4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c" + dependencies: + assertion-error "^1.0.1" + check-error "^1.0.1" + deep-eql "^3.0.0" + get-func-name "^2.0.0" + pathval "^1.0.0" + type-detect "^4.0.0" + +chalk@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0, chalk@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.1.0.tgz#ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e" + dependencies: + ansi-styles "^3.1.0" + escape-string-regexp "^1.0.5" + supports-color "^4.0.0" + +check-error@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +color-convert@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + +combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" + dependencies: + delayed-stream "~1.0.0" + +commander@2.11.0, commander@^2.9.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +convert-source-map@^1.3.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" + +core-js@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" + +coveralls@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.0.tgz#22ef730330538080d29b8c151dc9146afde88a99" + dependencies: + js-yaml "^3.6.1" + lcov-parse "^0.0.10" + log-driver "^1.2.5" + minimist "^1.2.0" + request "^2.79.0" + +cross-spawn@^4, cross-spawn@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + +cryptiles@3.x.x: + version "3.1.2" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" + dependencies: + boom "5.x.x" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +debug-log@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" + +debug@3.1.0, debug@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + dependencies: + ms "2.0.0" + +debug@^2.2.0: + version "2.6.8" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" + dependencies: + ms "2.0.0" + +decamelize@^1.0.0, decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +deep-eql@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + dependencies: + type-detect "^4.0.0" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +default-require-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" + dependencies: + strip-bom "^2.0.0" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +diff@3.3.1, diff@^3.1.0, diff@^3.2.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" + +ecc-jsbn@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + dependencies: + jsbn "~0.1.0" + +error-ex@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +escodegen@1.8.x: + version "1.8.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" + dependencies: + esprima "^2.7.1" + estraverse "^1.9.1" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.2.0" + +esprima@2.7.x, esprima@^2.6.0, esprima@^2.7.1: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + +estraverse@^1.9.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +execa@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" + dependencies: + cross-spawn "^4.0.0" + get-stream "^2.2.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +extend@~3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +extsprintf@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" + +fast-deep-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +find-cache-dir@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" + dependencies: + commondir "^1.0.1" + mkdirp "^0.5.1" + pkg-dir "^1.0.0" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +foreground-child@^1.5.3, foreground-child@^1.5.6: + version "1.5.6" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" + dependencies: + cross-spawn "^4" + signal-exit "^3.0.0" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.1.tgz#6fb94fbd71885306d73d15cc497fe4cc4ecd44bf" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +get-caller-file@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + +get-stream@^2.2.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" + dependencies: + object-assign "^4.0.1" + pinkie-promise "^2.0.0" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob@7.1.2, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^5.0.15: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.0.0: + version "9.17.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +growl@1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" + +handlebars@^4.0.1, handlebars@^4.0.3: + version "4.0.7" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.7.tgz#e97325aeb8ea0b9e12b9c4dd73c4c312ad0ede59" + dependencies: + async "^1.4.0" + optimist "^0.6.1" + source-map "^0.4.4" + optionalDependencies: + uglify-js "^2.6" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + +har-validator@~5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" + dependencies: + ajv "^5.1.0" + har-schema "^2.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + +hawk@~6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" + dependencies: + boom "4.x.x" + cryptiles "3.x.x" + hoek "4.x.x" + sntp "2.x.x" + +he@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + +hoek@4.x.x: + version "4.2.0" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" + +hosted-git-info@^2.1.4: + version "2.4.2" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +invariant@^2.2.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-buffer@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-dotfile@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-number@^2.0.2, is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +isarray@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +istanbul-lib-coverage@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" + +istanbul-lib-hook@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.1.0.tgz#8538d970372cb3716d53e55523dd54b557a8d89b" + dependencies: + append-transform "^0.4.0" + +istanbul-lib-instrument@^1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.1.tgz#250b30b3531e5d3251299fdd64b0b2c9db6b558e" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.1.1" + semver "^5.3.0" + +istanbul-lib-report@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.2.tgz#922be27c13b9511b979bd1587359f69798c1d425" + dependencies: + istanbul-lib-coverage "^1.1.1" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.2.tgz#750578602435f28a0c04ee6d7d9e0f2960e62c1c" + dependencies: + debug "^3.1.0" + istanbul-lib-coverage "^1.1.1" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.3.tgz#3b9e1e8defb6d18b1d425da8e8b32c5a163f2d10" + dependencies: + handlebars "^4.0.3" + +istanbul@^0.4.5: + version "0.4.5" + resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" + dependencies: + abbrev "1.0.x" + async "1.x" + escodegen "1.8.x" + esprima "2.7.x" + glob "^5.0.15" + handlebars "^4.0.1" + js-yaml "3.x" + mkdirp "0.5.x" + nopt "3.x" + once "1.x" + resolve "1.1.x" + supports-color "^3.1.0" + which "^1.1.1" + wordwrap "^1.0.0" + +jodid25519@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" + dependencies: + jsbn "~0.1.0" + +js-tokens@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" + +js-yaml@3.x, js-yaml@^3.6.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30" + dependencies: + argparse "^1.0.7" + esprima "^2.6.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +json-schema-traverse@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsprim@^1.2.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" + dependencies: + assert-plus "1.0.0" + extsprintf "1.0.2" + json-schema "0.2.3" + verror "1.3.6" + +kind-of@^3.0.2: + version "3.2.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.0.tgz#b58abe4d5c044ad33726a8c1525b48cf891bff07" + dependencies: + is-buffer "^1.1.5" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + +lcov-parse@^0.0.10: + version "0.0.10" + resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash@^4.2.0: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +log-driver@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.5.tgz#7ae4ec257302fd790d557cb10c97100d857b0056" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loose-envify@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +lru-cache@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" + dependencies: + pseudomap "^1.0.1" + yallist "^2.0.0" + +make-error@^1.1.1: + version "1.2.3" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.2.3.tgz#6c4402df732e0977ac6faf754a5074b3d2b1d19d" + +md5-hex@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" + dependencies: + md5-o-matic "^0.1.1" + +md5-o-matic@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3" + +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + dependencies: + mimic-fn "^1.0.0" + +merge-source-map@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.0.3.tgz#da1415f2722a5119db07b14c4f973410863a2abf" + dependencies: + source-map "^0.5.3" + +micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +mime-db@~1.30.0: + version "1.30.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" + +mime-types@^2.1.12, mime-types@~2.1.17: + version "2.1.17" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" + dependencies: + mime-db "~1.30.0" + +mimic-fn@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" + +"minimatch@2 || 3", minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8, minimist@~0.0.1: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +mocha-lcov-reporter@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/mocha-lcov-reporter/-/mocha-lcov-reporter-1.3.0.tgz#469bdef4f8afc9a116056f079df6182d0afb0384" + +mocha@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.0.1.tgz#0aee5a95cf69a4618820f5e51fa31717117daf1b" + dependencies: + browser-stdout "1.3.0" + commander "2.11.0" + debug "3.1.0" + diff "3.3.1" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.3" + he "1.1.1" + mkdirp "0.5.1" + supports-color "4.4.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +nopt@3.x: + version "3.0.6" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + dependencies: + abbrev "1" + +normalize-package-data@^2.3.2: + version "2.3.8" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.8.tgz#d819eda2a9dedbd1ffa563ea4071d936782295bb" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +nyc@^11.3.0: + version "11.3.0" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-11.3.0.tgz#a42bc17b3cfa41f7b15eb602bc98b2633ddd76f0" + dependencies: + archy "^1.0.0" + arrify "^1.0.1" + caching-transform "^1.0.0" + convert-source-map "^1.3.0" + debug-log "^1.0.1" + default-require-extensions "^1.0.0" + find-cache-dir "^0.1.1" + find-up "^2.1.0" + foreground-child "^1.5.3" + glob "^7.0.6" + istanbul-lib-coverage "^1.1.1" + istanbul-lib-hook "^1.1.0" + istanbul-lib-instrument "^1.9.1" + istanbul-lib-report "^1.1.2" + istanbul-lib-source-maps "^1.2.2" + istanbul-reports "^1.1.3" + md5-hex "^1.2.0" + merge-source-map "^1.0.2" + micromatch "^2.3.11" + mkdirp "^0.5.0" + resolve-from "^2.0.0" + rimraf "^2.5.4" + signal-exit "^3.0.1" + spawn-wrap "=1.3.8" + test-exclude "^4.1.1" + yargs "^10.0.3" + yargs-parser "^8.0.0" + +oauth-sign@~0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +once@1.x, once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-homedir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-locale@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.0.0.tgz#15918ded510522b81ee7ae5a309d54f639fc39a4" + dependencies: + execa "^0.5.0" + lcid "^1.0.0" + mem "^1.1.0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +pathval@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + dependencies: + find-up "^1.0.0" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +pseudomap@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +qs@~6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" + +randomatic@^1.1.3: + version "1.1.6" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb" + dependencies: + is-number "^2.0.2" + kind-of "^3.0.2" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +regenerator-runtime@^0.10.0: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + +regex-cache@^0.4.2: + version "0.4.3" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145" + dependencies: + is-equal-shallow "^0.1.3" + is-primitive "^2.0.0" + +remove-trailing-separator@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.1.tgz#615ebb96af559552d4bf4057c8436d486ab63cc4" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +request@^2.79.0: + version "2.83.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.6.0" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.1" + forever-agent "~0.6.1" + form-data "~2.3.1" + har-validator "~5.0.3" + hawk "~6.0.2" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.17" + oauth-sign "~0.8.2" + performance-now "^2.1.0" + qs "~6.5.1" + safe-buffer "^5.1.1" + stringstream "~0.0.5" + tough-cookie "~2.3.3" + tunnel-agent "^0.6.0" + uuid "^3.1.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +resolve-from@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" + +resolve@1.1.x: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@^1.3.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" + dependencies: + path-parse "^1.0.5" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@^2.3.3, rimraf@^2.5.4, rimraf@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" + dependencies: + glob "^7.0.5" + +safe-buffer@^5.0.1, safe-buffer@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + +"semver@2 || 3 || 4 || 5", semver@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +signal-exit@^3.0.0, signal-exit@^3.0.1, signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +slide@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + +sntp@2.x.x: + version "2.0.2" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.0.2.tgz#5064110f0af85f7cfdb7d6b67a40028ce52b4b2b" + dependencies: + hoek "4.x.x" + +source-map-support@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.0.tgz#2018a7ad2bdf8faf2691e5fddab26bed5a2bacab" + dependencies: + source-map "^0.6.0" + +source-map-support@^0.4.0: + version "0.4.15" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1" + dependencies: + source-map "^0.5.6" + +source-map@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + +source-map@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" + dependencies: + amdefine ">=0.0.4" + +spawn-wrap@=1.3.8: + version "1.3.8" + resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.3.8.tgz#fa2a79b990cbb0bb0018dca6748d88367b19ec31" + dependencies: + foreground-child "^1.5.6" + mkdirp "^0.5.0" + os-homedir "^1.0.1" + rimraf "^2.3.3" + signal-exit "^3.0.2" + which "^1.2.4" + +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" + dependencies: + spdx-license-ids "^1.0.2" + +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +sshpk@^1.7.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.0.tgz#ff2a3e4fd04497555fed97b39a0fd82fafb3a33c" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jodid25519 "^1.0.0" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^3.0.0" + +stringstream@~0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + +strip-json-comments@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@4.4.0, supports-color@^4.0.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" + dependencies: + has-flag "^2.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^3.1.0, supports-color@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" + dependencies: + has-flag "^1.0.0" + +test-exclude@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" + dependencies: + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + +to-fast-properties@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +tough-cookie@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" + dependencies: + punycode "^1.4.1" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +ts-node@3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-3.3.0.tgz#c13c6a3024e30be1180dd53038fc209289d4bf69" + dependencies: + arrify "^1.0.0" + chalk "^2.0.0" + diff "^3.1.0" + make-error "^1.1.1" + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map-support "^0.4.0" + tsconfig "^6.0.0" + v8flags "^3.0.0" + yn "^2.0.0" + +tsconfig@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-6.0.0.tgz#6b0e8376003d7af1864f8df8f89dd0059ffcd032" + dependencies: + strip-bom "^3.0.0" + strip-json-comments "^2.0.0" + +tslib@^1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.7.1.tgz#bc8004164691923a79fe8378bbeb3da2017538ec" + +tslint@5.8.0: + version "5.8.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.8.0.tgz#1f49ad5b2e77c76c3af4ddcae552ae4e3612eb13" + dependencies: + babel-code-frame "^6.22.0" + builtin-modules "^1.1.1" + chalk "^2.1.0" + commander "^2.9.0" + diff "^3.2.0" + glob "^7.1.1" + minimatch "^3.0.4" + resolve "^1.3.2" + semver "^5.3.0" + tslib "^1.7.1" + tsutils "^2.12.1" + +tsutils@^2.12.1: + version "2.12.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.12.1.tgz#f4d95ce3391c8971e46e54c4cf0edb0a21dd5b24" + dependencies: + tslib "^1.7.1" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +type-detect@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.3.tgz#0e3f2670b44099b0b46c284d136a7ef49c74c2ea" + +typescript@2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.1.tgz#ef39cdea27abac0b500242d6726ab90e0c846631" + +uglify-js@^2.6: + version "2.8.22" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.22.tgz#d54934778a8da14903fa29a326fb24c0ab51a1a0" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +user-home@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" + +uuid@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" + +v8flags@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.0.0.tgz#4be9604488e0c4123645def705b1848d16b8e01f" + dependencies: + user-home "^1.1.1" + +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" + +verror@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c" + dependencies: + extsprintf "1.0.2" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@^1.1.1, which@^1.2.4, which@^1.2.9: + version "1.2.14" + resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" + dependencies: + isexe "^2.0.0" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@^1.0.0, wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write-file-atomic@^1.1.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + slide "^1.1.5" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + +yallist@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + +yargs-parser@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.0.0.tgz#21d476330e5a82279a4b881345bf066102e219c6" + dependencies: + camelcase "^4.1.0" + +yargs@^10.0.3: + version "10.0.3" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.0.3.tgz#6542debd9080ad517ec5048fb454efe9e4d4aaae" + dependencies: + cliui "^3.2.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^8.0.0" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" + +yn@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/package.json b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/package.json index fe5b16d55..3ae0fb9ab 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/package.json +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/package.json @@ -1,71 +1,118 @@ { - "_args": [ - [ - "socks@1.1.10", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_from": "socks@1.1.10", - "_id": "socks@1.1.10", + "_from": "socks@~2.1.6", + "_id": "socks@2.1.6", "_inBundle": false, - "_integrity": "sha1-W4t/x8jzQcU+0FbpKbe/Tei6e1o=", + "_integrity": "sha512-cHaaOUfK1FIyUv5T9Tg5y7apRqluAjgCzCeOg9Eg3E4ooGJocGgQ+BEHp5o4ev2DBjkmroNjWl1njijx0epv4Q==", "_location": "/libnpmhook/npm-registry-fetch/make-fetch-happen/socks-proxy-agent/socks", "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "range", "registry": true, - "raw": "socks@1.1.10", + "raw": "socks@~2.1.6", "name": "socks", "escapedName": "socks", - "rawSpec": "1.1.10", + "rawSpec": "~2.1.6", "saveSpec": null, - "fetchSpec": "1.1.10" + "fetchSpec": "~2.1.6" }, "_requiredBy": [ "/libnpmhook/npm-registry-fetch/make-fetch-happen/socks-proxy-agent" ], - "_resolved": "https://registry.npmjs.org/socks/-/socks-1.1.10.tgz", - "_spec": "1.1.10", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/socks/-/socks-2.1.6.tgz", + "_shasum": "684d98e137bdba484f3f4b13bacecb9fa5acc597", + "_spec": "socks@~2.1.6", + "_where": "/Users/rebecca/code/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent", "author": { "name": "Josh Glazebrook" }, "bugs": { "url": "https://github.com/JoshGlazebrook/socks/issues" }, - "contributors": [ - { - "name": "Samuel Gordalina" - } - ], + "bundleDependencies": false, "dependencies": { - "ip": "^1.1.4", - "smart-buffer": "^1.0.13" + "ip": "^1.1.5", + "smart-buffer": "^4.0.1" + }, + "deprecated": false, + "description": "Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.", + "devDependencies": { + "@types/chai": "4.0.8", + "@types/ip": "^0.0.30", + "@types/mocha": "^2.2.44", + "@types/node": "8.0.57", + "chai": "^4.1.2", + "coveralls": "^3.0.0", + "mocha": "^4.0.1", + "nyc": "11.4.0", + "prettier": "^1.9.2", + "socks5-server": "^0.1.1", + "ts-node": "^3.3.0", + "tslint": "^5.8.0", + "typescript": "2.6.2" }, - "description": "A SOCKS proxy client supporting SOCKS 4, 4a, and 5. (also supports BIND/Associate)", "engines": { - "node": ">= 0.10.0", - "npm": ">= 1.3.5" + "node": ">= 6.0.0", + "npm": ">= 3.0.0" }, - "homepage": "https://github.com/JoshGlazebrook/socks", + "homepage": "https://github.com/JoshGlazebrook/socks/", "keywords": [ "socks", "proxy", - "client", "tor", - "bind", - "associate", "socks 4", - "socks 4a", "socks 5", - "agent" + "socks4", + "socks5" ], "license": "MIT", - "main": "index.js", + "main": "build/index.js", "name": "socks", + "nyc": { + "extension": [ + ".ts", + ".tsx" + ], + "include": [ + "src/*.ts", + "src/**/*.ts" + ], + "exclude": [ + "**.*.d.ts", + "node_modules", + "typings" + ], + "require": [ + "ts-node/register" + ], + "reporter": [ + "json", + "html" + ], + "all": true + }, + "private": false, "repository": { "type": "git", "url": "git+https://github.com/JoshGlazebrook/socks.git" }, - "version": "1.1.10" + "scripts": { + "build": "tslint --project tsconfig.json && prettier --write ./src/**/*.ts --config .prettierrc.yaml && tsc -p .", + "coverage": "NODE_ENV=test nyc npm test", + "coveralls": "NODE_ENV=test nyc npm test && nyc report --reporter=text-lcov | coveralls", + "lint": "tslint --project tsconfig.json 'src/**/*.ts'", + "prepublish": "npm install -g typescript && npm run build", + "test": "NODE_ENV=test mocha --recursive --compilers ts:ts-node/register test/**/*.ts" + }, + "typings": "typings", + "version": "2.1.6", + "warnings": [ + { + "code": "ENOTSUP", + "required": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "pkgid": "socks@2.1.6" + } + ] } diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/client/socksclient.d.ts b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/client/socksclient.d.ts new file mode 100644 index 000000000..8a88aabb6 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/client/socksclient.d.ts @@ -0,0 +1,157 @@ +/// <reference types="node" /> +import { EventEmitter } from 'events'; +import * as net from 'net'; +import { SocksClientOptions, SocksClientChainOptions, SocksRemoteHost, SocksProxy, SocksClientBoundEvent, SocksClientEstablishedEvent, SocksUDPFrameDetails } from '../common/constants'; +import { SocksClientError } from '../common/util'; +interface SocksClient { + on(event: 'error', listener: (err: SocksClientError) => void): this; + on(event: 'bound', listener: (info: SocksClientBoundEvent) => void): this; + on(event: 'established', listener: (info: SocksClientEstablishedEvent) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'error', listener: (err: SocksClientError) => void): this; + once(event: 'bound', listener: (info: SocksClientBoundEvent) => void): this; + once(event: 'established', listener: (info: SocksClientEstablishedEvent) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'error', err: SocksClientError): boolean; + emit(event: 'bound', info: SocksClientBoundEvent): boolean; + emit(event: 'established', info: SocksClientEstablishedEvent): boolean; +} +declare class SocksClient extends EventEmitter implements SocksClient { + private _options; + private _socket; + private _state; + private _receiveBuffer; + private _nextRequiredPacketBufferSize; + private _onDataReceived; + private _onClose; + private _onError; + private _onConnect; + constructor(options: SocksClientOptions); + /** + * Creates a new SOCKS connection. + * + * Note: Supports callbacks and promises. Only supports the connect command. + * @param options { SocksClientOptions } Options. + * @param callback { Function } An optional callback function. + * @returns { Promise } + */ + static createConnection(options: SocksClientOptions, callback?: Function): Promise<SocksClientEstablishedEvent>; + /** + * Creates a new SOCKS connection chain to a destination host through 2 or more SOCKS proxies. + * + * Note: Supports callbacks and promises. Only supports the connect method. + * Note: Implemented via createConnection() factory function. + * @param options { SocksClientChainOptions } Options + * @param callback { Function } An optional callback function. + * @returns { Promise } + */ + static createConnectionChain(options: SocksClientChainOptions, callback?: Function): Promise<SocksClientEstablishedEvent>; + /** + * Creates a SOCKS UDP Frame. + * @param options + */ + static createUDPFrame(options: SocksUDPFrameDetails): Buffer; + /** + * Parses a SOCKS UDP frame. + * @param data + */ + static parseUDPFrame(data: Buffer): SocksUDPFrameDetails; + /** + * Gets the SocksClient internal state. + */ + /** + * Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state. + */ + private state; + /** + * Starts the connection establishment to the proxy and destination. + * @param existing_socket Connected socket to use instead of creating a new one (internal use). + */ + connect(existing_socket?: net.Socket): void; + /** + * Handles internal Socks timeout callback. + * Note: If the Socks client is not BoundWaitingForConnection or Established, the connection will be closed. + */ + private onEstablishedTimeout(); + /** + * Handles Socket connect event. + */ + private onConnect(); + /** + * Handles Socket data event. + * @param data + */ + private onDataReceived(data); + /** + * Handles processing of the data we have received. + */ + private processData(); + /** + * Handles Socket close event. + * @param had_error + */ + private onClose(); + /** + * Handles Socket error event. + * @param err + */ + private onError(err); + /** + * Removes internal event listeners on the underlying Socket. + */ + private removeInternalSocketHandlers(); + /** + * Closes and destroys the underlying Socket. Emits an error event. + * @param err { String } An error string to include in error event. + */ + private _closeSocket(err); + /** + * Sends initial Socks v4 handshake request. + */ + private sendSocks4InitialHandshake(); + /** + * Handles Socks v4 handshake response. + * @param data + */ + private handleSocks4FinalHandshakeResponse(); + /** + * Handles Socks v4 incoming connection request (BIND) + * @param data + */ + private handleSocks4IncomingConnectionResponse(); + /** + * Sends initial Socks v5 handshake request. + */ + private sendSocks5InitialHandshake(); + /** + * Handles initial Socks v5 handshake response. + * @param data + */ + private handleInitialSocks5HandshakeResponse(); + /** + * Sends Socks v5 user & password auth handshake. + * + * Note: No auth and user/pass are currently supported. + */ + private sendSocks5UserPassAuthentication(); + /** + * Handles Socks v5 auth handshake response. + * @param data + */ + private handleInitialSocks5AuthenticationHandshakeResponse(); + /** + * Sends Socks v5 final handshake request. + */ + private sendSocks5CommandRequest(); + /** + * Handles Socks v5 final handshake response. + * @param data + */ + private handleSocks5FinalHandshakeResponse(); + /** + * Handles Socks v5 incoming connection request (BIND). + */ + private handleSocks5IncomingConnectionResponse(); + readonly socksClientOptions: SocksClientOptions; +} +export { SocksClient, SocksClientOptions, SocksClientChainOptions, SocksRemoteHost, SocksProxy, SocksUDPFrameDetails }; diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/common/constants.d.ts b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/common/constants.d.ts new file mode 100644 index 000000000..667378dac --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/common/constants.d.ts @@ -0,0 +1,136 @@ +/// <reference types="node" /> +import { Socket } from 'net'; +declare const DEFAULT_TIMEOUT = 30000; +declare type SocksProxyType = 4 | 5; +declare const ERRORS: { + InvalidSocksCommand: string; + InvalidSocksCommandForOperation: string; + InvalidSocksCommandChain: string; + InvalidSocksClientOptionsDestination: string; + InvalidSocksClientOptionsExistingSocket: string; + InvalidSocksClientOptionsProxy: string; + InvalidSocksClientOptionsTimeout: string; + InvalidSocksClientOptionsProxiesLength: string; + NegotiationError: string; + SocketClosed: string; + ProxyConnectionTimedOut: string; + InternalError: string; + InvalidSocks4HandshakeResponse: string; + Socks4ProxyRejectedConnection: string; + InvalidSocks4IncomingConnectionResponse: string; + Socks4ProxyRejectedIncomingBoundConnection: string; + InvalidSocks5InitialHandshakeResponse: string; + InvalidSocks5IntiailHandshakeSocksVersion: string; + InvalidSocks5InitialHandshakeNoAcceptedAuthType: string; + InvalidSocks5InitialHandshakeUnknownAuthType: string; + Socks5AuthenticationFailed: string; + InvalidSocks5FinalHandshake: string; + InvalidSocks5FinalHandshakeRejected: string; + InvalidSocks5IncomingConnectionResponse: string; + Socks5ProxyRejectedIncomingBoundConnection: string; +}; +declare const SOCKS_INCOMING_PACKET_SIZES: { + Socks5InitialHandshakeResponse: number; + Socks5UserPassAuthenticationResponse: number; + Socks5ResponseHeader: number; + Socks5ResponseIPv4: number; + Socks5ResponseIPv6: number; + Socks5ResponseHostname: (hostNameLength: number) => number; + Socks4Response: number; +}; +declare type SocksCommandOption = 'connect' | 'bind' | 'associate'; +declare enum SocksCommand { + connect = 1, + bind = 2, + associate = 3, +} +declare enum Socks4Response { + Granted = 90, + Failed = 91, + Rejected = 92, + RejectedIdent = 93, +} +declare enum Socks5Auth { + NoAuth = 0, + GSSApi = 1, + UserPass = 2, +} +declare enum Socks5Response { + Granted = 0, + Failure = 1, + NotAllowed = 2, + NetworkUnreachable = 3, + HostUnreachable = 4, + ConnectionRefused = 5, + TTLExpired = 6, + CommandNotSupported = 7, + AddressNotSupported = 8, +} +declare enum Socks5HostType { + IPv4 = 1, + Hostname = 3, + IPv6 = 4, +} +declare enum SocksClientState { + Created = 0, + Connecting = 1, + Connected = 2, + SentInitialHandshake = 3, + ReceivedInitialHandshakeResponse = 4, + SentAuthentication = 5, + ReceivedAuthenticationResponse = 6, + SentFinalHandshake = 7, + ReceivedFinalResponse = 8, + BoundWaitingForConnection = 9, + Established = 10, + Disconnected = 11, + Error = 99, +} +/** + * Represents a SocksProxy + */ +interface SocksProxy { + ipaddress: string; + port: number; + type: SocksProxyType; + userId?: string; + password?: string; +} +/** + * Represents a remote host + */ +interface SocksRemoteHost { + host: string; + port: number; +} +/** + * SocksClient connection options. + */ +interface SocksClientOptions { + command: SocksCommandOption; + destination: SocksRemoteHost; + proxy: SocksProxy; + timeout?: number; + existing_socket?: Socket; +} +/** + * SocksClient chain connection options. + */ +interface SocksClientChainOptions { + command: 'connect'; + destination: SocksRemoteHost; + proxies: SocksProxy[]; + timeout?: number; + randomizeChain?: false; +} +interface SocksClientEstablishedEvent { + socket: Socket; + remoteHost?: SocksRemoteHost; +} +declare type SocksClientBoundEvent = SocksClientEstablishedEvent; +interface SocksUDPFrameDetails { + frameNumber?: number; + remoteHost: SocksRemoteHost; + data: Buffer; +} +export { DEFAULT_TIMEOUT, ERRORS, SocksProxyType, SocksCommand, Socks4Response, Socks5Auth, Socks5HostType, Socks5Response, SocksClientState, SocksProxy, SocksRemoteHost, SocksCommandOption, SocksClientOptions, SocksClientChainOptions, SocksClientEstablishedEvent, SocksClientBoundEvent, SocksUDPFrameDetails, SOCKS_INCOMING_PACKET_SIZES }; diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/common/helpers.d.ts b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/common/helpers.d.ts new file mode 100644 index 000000000..8c3a10697 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/common/helpers.d.ts @@ -0,0 +1,13 @@ +import { SocksClientOptions, SocksClientChainOptions } from '../client/socksclient'; +/** + * Validates the provided SocksClientOptions + * @param options { SocksClientOptions } + * @param acceptedCommands { string[] } A list of accepted SocksProxy commands. + */ +declare function validateSocksClientOptions(options: SocksClientOptions, acceptedCommands?: string[]): void; +/** + * Validates the SocksClientChainOptions + * @param options { SocksClientChainOptions } + */ +declare function validateSocksClientChainOptions(options: SocksClientChainOptions): void; +export { validateSocksClientOptions, validateSocksClientChainOptions }; diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/common/receiveBuffer.d.ts b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/common/receiveBuffer.d.ts new file mode 100644 index 000000000..fe506a035 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/common/receiveBuffer.d.ts @@ -0,0 +1,12 @@ +/// <reference types="node" /> +declare class ReceiveBuffer { + private _buffer; + private _offset; + private _originalSize; + constructor(size?: number); + readonly length: number; + append(data: Buffer): number; + peek(length: number): Buffer; + get(length: number): Buffer; +} +export { ReceiveBuffer }; diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/common/util.d.ts b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/common/util.d.ts new file mode 100644 index 000000000..14f658e22 --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/common/util.d.ts @@ -0,0 +1,14 @@ +import { SocksClientOptions, SocksClientChainOptions } from './constants'; +/** + * Error wrapper for SocksClient + */ +declare class SocksClientError extends Error { + options: SocksClientOptions | SocksClientChainOptions; + constructor(message: string, options: SocksClientOptions | SocksClientChainOptions); +} +/** + * Shuffles a given array. + * @param array The array to shuffle. + */ +declare function shuffleArray(array: any[]): void; +export { SocksClientError, shuffleArray }; diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/index.d.ts b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/index.d.ts new file mode 100644 index 000000000..fbf9006ef --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/typings/index.d.ts @@ -0,0 +1 @@ +export * from './client/socksclient'; diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/yarn.lock b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/yarn.lock new file mode 100644 index 000000000..dc522718d --- /dev/null +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/yarn.lock @@ -0,0 +1,1790 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/chai@4.0.8": + version "4.0.8" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.0.8.tgz#d27600e9ba2f371e08695d90a0fe0408d89c7be7" + +"@types/ip@^0.0.30": + version "0.0.30" + resolved "https://registry.yarnpkg.com/@types/ip/-/ip-0.0.30.tgz#60c3309ce1cecdd7293245bbffc201ecb6f8c344" + +"@types/mocha@^2.2.44": + version "2.2.44" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.44.tgz#1d4a798e53f35212fd5ad4d04050620171cd5b5e" + +"@types/node@8.0.57": + version "8.0.57" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.57.tgz#e5d8b4dc112763e35cfc51988f4f38da3c486d99" + +ajv@^5.1.0: + version "5.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" + dependencies: + color-convert "^1.9.0" + +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + dependencies: + default-require-extensions "^1.0.0" + +archy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +arrify@^1.0.0, arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asn1@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assertion-error@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" + +async@^1.4.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + +aws4@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" + +babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-generator@^6.18.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.6" + trim-right "^1.0.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.16.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.18.0, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.18.0, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +bcrypt-pbkdf@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + dependencies: + tweetnacl "^0.14.3" + +boom@4.x.x: + version "4.3.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" + dependencies: + hoek "4.x.x" + +boom@5.x.x: + version "5.2.0" + resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" + dependencies: + hoek "4.x.x" + +brace-expansion@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +browser-stdout@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" + +builtin-modules@^1.0.0, builtin-modules@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +caching-transform@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-1.0.1.tgz#6dbdb2f20f8d8fbce79f3e94e9d1742dcdf5c0a1" + dependencies: + md5-hex "^1.2.0" + mkdirp "^0.5.1" + write-file-atomic "^1.1.4" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chai@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c" + dependencies: + assertion-error "^1.0.1" + check-error "^1.0.1" + deep-eql "^3.0.0" + get-func-name "^2.0.0" + pathval "^1.0.0" + type-detect "^4.0.0" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0, chalk@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" + dependencies: + ansi-styles "^3.1.0" + escape-string-regexp "^1.0.5" + supports-color "^4.0.0" + +check-error@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +color-convert@^1.9.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + +combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" + dependencies: + delayed-stream "~1.0.0" + +commander@2.11.0, commander@^2.9.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +convert-source-map@^1.3.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" + +core-js@^2.4.0: + version "2.5.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.1.tgz#ae6874dc66937789b80754ff5428df66819ca50b" + +core-util-is@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +coveralls@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.0.tgz#22ef730330538080d29b8c151dc9146afde88a99" + dependencies: + js-yaml "^3.6.1" + lcov-parse "^0.0.10" + log-driver "^1.2.5" + minimist "^1.2.0" + request "^2.79.0" + +cross-spawn@^4: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + +cross-spawn@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +cryptiles@3.x.x: + version "3.1.2" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" + dependencies: + boom "5.x.x" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +debug-log@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" + +debug@3.1.0, debug@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + dependencies: + ms "2.0.0" + +debug@^2.2.0, debug@^2.6.8: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +decamelize@^1.0.0, decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +deep-eql@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + dependencies: + type-detect "^4.0.0" + +default-require-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" + dependencies: + strip-bom "^2.0.0" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +diff@3.3.1, diff@^3.1.0, diff@^3.2.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" + +ecc-jsbn@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + dependencies: + jsbn "~0.1.0" + +error-ex@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +esprima@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +extend@~3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +extsprintf@1.3.0, extsprintf@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + +fast-deep-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +find-cache-dir@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" + dependencies: + commondir "^1.0.1" + mkdirp "^0.5.1" + pkg-dir "^1.0.0" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +foreground-child@^1.5.3, foreground-child@^1.5.6: + version "1.5.6" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" + dependencies: + cross-spawn "^4" + signal-exit "^3.0.0" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.1.tgz#6fb94fbd71885306d73d15cc497fe4cc4ecd44bf" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +get-caller-file@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob@7.1.2, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +growl@1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" + +handlebars@^4.0.3: + version "4.0.11" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" + dependencies: + async "^1.4.0" + optimist "^0.6.1" + source-map "^0.4.4" + optionalDependencies: + uglify-js "^2.6" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + +har-validator@~5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" + dependencies: + ajv "^5.1.0" + har-schema "^2.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + +hawk@~6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" + dependencies: + boom "4.x.x" + cryptiles "3.x.x" + hoek "4.x.x" + sntp "2.x.x" + +he@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + +hoek@4.x.x: + version "4.2.0" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" + +homedir-polyfill@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" + dependencies: + parse-passwd "^1.0.0" + +hosted-git-info@^2.1.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +invariant@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + +ip@^1.1.0, ip@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +isarray@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +istanbul-lib-coverage@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" + +istanbul-lib-hook@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.1.0.tgz#8538d970372cb3716d53e55523dd54b557a8d89b" + dependencies: + append-transform "^0.4.0" + +istanbul-lib-instrument@^1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.1.tgz#250b30b3531e5d3251299fdd64b0b2c9db6b558e" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.1.1" + semver "^5.3.0" + +istanbul-lib-report@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.2.tgz#922be27c13b9511b979bd1587359f69798c1d425" + dependencies: + istanbul-lib-coverage "^1.1.1" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.2.tgz#750578602435f28a0c04ee6d7d9e0f2960e62c1c" + dependencies: + debug "^3.1.0" + istanbul-lib-coverage "^1.1.1" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.3.tgz#3b9e1e8defb6d18b1d425da8e8b32c5a163f2d10" + dependencies: + handlebars "^4.0.3" + +js-tokens@^3.0.0, js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +js-yaml@^3.6.1: + version "3.10.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +json-schema-traverse@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +kind-of@^3.0.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + +lcov-parse@^0.0.10: + version "0.0.10" + resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash@^4.17.4: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +log-driver@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.5.tgz#7ae4ec257302fd790d557cb10c97100d857b0056" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loose-envify@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +lru-cache@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +make-error@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.0.tgz#52ad3a339ccf10ce62b4040b708fe707244b8b96" + +md5-hex@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" + dependencies: + md5-o-matic "^0.1.1" + +md5-o-matic@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3" + +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + dependencies: + mimic-fn "^1.0.0" + +merge-source-map@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.0.4.tgz#a5de46538dae84d4114cc5ea02b4772a6346701f" + dependencies: + source-map "^0.5.6" + +micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +mime-db@~1.30.0: + version "1.30.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" + +mime-types@^2.1.12, mime-types@~2.1.17: + version "2.1.17" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" + dependencies: + mime-db "~1.30.0" + +mimic-fn@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8, minimist@~0.0.1: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +mocha@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.0.1.tgz#0aee5a95cf69a4618820f5e51fa31717117daf1b" + dependencies: + browser-stdout "1.3.0" + commander "2.11.0" + debug "3.1.0" + diff "3.3.1" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.3" + he "1.1.1" + mkdirp "0.5.1" + supports-color "4.4.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +normalize-package-data@^2.3.2: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +nyc@11.4.0: + version "11.4.0" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-11.4.0.tgz#18634c24058c12a4b7c9872b846249fb96e30719" + dependencies: + archy "^1.0.0" + arrify "^1.0.1" + caching-transform "^1.0.0" + convert-source-map "^1.3.0" + debug-log "^1.0.1" + default-require-extensions "^1.0.0" + find-cache-dir "^0.1.1" + find-up "^2.1.0" + foreground-child "^1.5.3" + glob "^7.0.6" + istanbul-lib-coverage "^1.1.1" + istanbul-lib-hook "^1.1.0" + istanbul-lib-instrument "^1.9.1" + istanbul-lib-report "^1.1.2" + istanbul-lib-source-maps "^1.2.2" + istanbul-reports "^1.1.3" + md5-hex "^1.2.0" + merge-source-map "^1.0.2" + micromatch "^2.3.11" + mkdirp "^0.5.0" + resolve-from "^2.0.0" + rimraf "^2.5.4" + signal-exit "^3.0.1" + spawn-wrap "^1.4.1" + test-exclude "^4.1.1" + yargs "^10.0.3" + yargs-parser "^8.0.0" + +oauth-sign@~0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +once@^1.3.0, once@^1.3.3: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +os-homedir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +parse-passwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +pathval@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + dependencies: + find-up "^1.0.0" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +prettier@^1.9.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.9.2.tgz#96bc2132f7a32338e6078aeb29727178c6335827" + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +qs@~6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" + +randomatic@^1.1.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +regenerator-runtime@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz#7e54fe5b5ccd5d6624ea6255c3473be090b802e1" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + dependencies: + is-equal-shallow "^0.1.3" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +request@^2.79.0: + version "2.83.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.6.0" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.1" + forever-agent "~0.6.1" + form-data "~2.3.1" + har-validator "~5.0.3" + hawk "~6.0.2" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.17" + oauth-sign "~0.8.2" + performance-now "^2.1.0" + qs "~6.5.1" + safe-buffer "^5.1.1" + stringstream "~0.0.5" + tough-cookie "~2.3.3" + tunnel-agent "^0.6.0" + uuid "^3.1.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +resolve-from@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" + +resolve@^1.3.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" + dependencies: + path-parse "^1.0.5" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + dependencies: + glob "^7.0.5" + +safe-buffer@^5.0.1, safe-buffer@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + +"semver@2 || 3 || 4 || 5", semver@^5.3.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + +signal-exit@^3.0.0, signal-exit@^3.0.1, signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +slide@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + +smart-buffer@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.1.tgz#07ea1ca8d4db24eb4cac86537d7d18995221ace3" + +sntp@2.x.x: + version "2.1.0" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" + dependencies: + hoek "4.x.x" + +socks5-server@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/socks5-server/-/socks5-server-0.1.1.tgz#6542d277bcb55b68c2910430d4112ccca58c0189" + dependencies: + debug "^2.2.0" + ip "^1.1.0" + once "^1.3.3" + +source-map-support@^0.4.0: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +spawn-wrap@^1.4.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.4.2.tgz#cff58e73a8224617b6561abdc32586ea0c82248c" + dependencies: + foreground-child "^1.5.6" + mkdirp "^0.5.0" + os-homedir "^1.0.1" + rimraf "^2.6.2" + signal-exit "^3.0.2" + which "^1.3.0" + +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" + dependencies: + spdx-license-ids "^1.0.2" + +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +sshpk@^1.7.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +stringstream@~0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + +strip-json-comments@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@4.4.0, supports-color@^4.0.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" + dependencies: + has-flag "^2.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^3.1.2: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + dependencies: + has-flag "^1.0.0" + +test-exclude@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" + dependencies: + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +tough-cookie@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" + dependencies: + punycode "^1.4.1" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +ts-node@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-3.3.0.tgz#c13c6a3024e30be1180dd53038fc209289d4bf69" + dependencies: + arrify "^1.0.0" + chalk "^2.0.0" + diff "^3.1.0" + make-error "^1.1.1" + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map-support "^0.4.0" + tsconfig "^6.0.0" + v8flags "^3.0.0" + yn "^2.0.0" + +tsconfig@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-6.0.0.tgz#6b0e8376003d7af1864f8df8f89dd0059ffcd032" + dependencies: + strip-bom "^3.0.0" + strip-json-comments "^2.0.0" + +tslib@^1.7.1: + version "1.8.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.8.0.tgz#dc604ebad64bcbf696d613da6c954aa0e7ea1eb6" + +tslint@^5.8.0: + version "5.8.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.8.0.tgz#1f49ad5b2e77c76c3af4ddcae552ae4e3612eb13" + dependencies: + babel-code-frame "^6.22.0" + builtin-modules "^1.1.1" + chalk "^2.1.0" + commander "^2.9.0" + diff "^3.2.0" + glob "^7.1.1" + minimatch "^3.0.4" + resolve "^1.3.2" + semver "^5.3.0" + tslib "^1.7.1" + tsutils "^2.12.1" + +tsutils@^2.12.1: + version "2.12.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.12.2.tgz#ad58a4865d17ec3ddb6631b6ca53be14a5656ff3" + dependencies: + tslib "^1.7.1" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +type-detect@^4.0.0: + version "4.0.5" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.5.tgz#d70e5bc81db6de2a381bcaca0c6e0cbdc7635de2" + +typescript@2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4" + +uglify-js@^2.6: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +uuid@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" + +v8flags@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.0.1.tgz#dce8fc379c17d9f2c9e9ed78d89ce00052b1b76b" + dependencies: + homedir-polyfill "^1.0.1" + +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@^1.2.9, which@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" + dependencies: + isexe "^2.0.0" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write-file-atomic@^1.1.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + slide "^1.1.5" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + +yargs-parser@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.0.0.tgz#21d476330e5a82279a4b881345bf066102e219c6" + dependencies: + camelcase "^4.1.0" + +yargs@^10.0.3: + version "10.0.3" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.0.3.tgz#6542debd9080ad517ec5048fb454efe9e4d4aaae" + dependencies: + cliui "^3.2.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^8.0.0" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" + +yn@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/package.json b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/package.json index 1e5c6ef6d..6dea41ef5 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/package.json +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/package.json @@ -1,32 +1,27 @@ { - "_args": [ - [ - "socks-proxy-agent@3.0.1", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_from": "socks-proxy-agent@3.0.1", - "_id": "socks-proxy-agent@3.0.1", + "_from": "socks-proxy-agent@^4.0.0", + "_id": "socks-proxy-agent@4.0.0", "_inBundle": false, - "_integrity": "sha512-ZwEDymm204mTzvdqyUqOdovVr2YRd2NYskrYrF2LXyZ9qDiMAoFESGK8CRphiO7rtbo2Y757k2Nia3x2hGtalA==", + "_integrity": "sha512-M0x7LYYRzKOEn5NchNPkUeVQ98hvUgwKI6URgnzB9L1Xwe1PBzX8pnThw5JYumzdLWW4qiY1XtBH7iFN21859A==", "_location": "/libnpmhook/npm-registry-fetch/make-fetch-happen/socks-proxy-agent", "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "range", "registry": true, - "raw": "socks-proxy-agent@3.0.1", + "raw": "socks-proxy-agent@^4.0.0", "name": "socks-proxy-agent", "escapedName": "socks-proxy-agent", - "rawSpec": "3.0.1", + "rawSpec": "^4.0.0", "saveSpec": null, - "fetchSpec": "3.0.1" + "fetchSpec": "^4.0.0" }, "_requiredBy": [ "/libnpmhook/npm-registry-fetch/make-fetch-happen" ], - "_resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-3.0.1.tgz", - "_spec": "3.0.1", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.0.tgz", + "_shasum": "e85e713bf30d5412364fbbcb6d628ff3437a41c0", + "_spec": "socks-proxy-agent@^4.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen", "author": { "name": "Nathan Rajlich", "email": "nathan@tootallnate.net", @@ -35,16 +30,21 @@ "bugs": { "url": "https://github.com/TooTallNate/node-socks-proxy-agent/issues" }, + "bundleDependencies": false, "dependencies": { - "agent-base": "^4.1.0", - "socks": "^1.1.10" + "agent-base": "~4.1.0", + "socks": "~2.1.6" }, + "deprecated": false, "description": "A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS", "devDependencies": { - "mocha": "^3.4.2", - "raw-body": "^2.2.0", + "mocha": "~3.4.2", + "raw-body": "~2.2.0", "socksv5": "0.0.6" }, + "engines": { + "node": ">= 6" + }, "homepage": "https://github.com/TooTallNate/node-socks-proxy-agent#readme", "keywords": [ "socks", @@ -65,5 +65,5 @@ "scripts": { "test": "mocha --reporter spec" }, - "version": "3.0.1" + "version": "4.0.0" } diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/package.json b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/package.json index befd7b231..7994a85a5 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/package.json +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/node_modules/make-fetch-happen/package.json @@ -1,70 +1,65 @@ { - "_args": [ - [ - "make-fetch-happen@3.0.0", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_from": "make-fetch-happen@3.0.0", - "_id": "make-fetch-happen@3.0.0", + "_from": "make-fetch-happen@^4.0.0", + "_id": "make-fetch-happen@4.0.1", "_inBundle": false, - "_integrity": "sha512-FmWY7gC0mL6Z4N86vE14+m719JKE4H0A+pyiOH18B025gF/C113pyfb4gHDDYP5cqnRMHOz06JGdmffC/SES+w==", + "_integrity": "sha512-7R5ivfy9ilRJ1EMKIOziwrns9fGeAD4bAha8EB7BIiBBLHm2KeTUGCrICFt2rbHfzheTLynv50GnNTK1zDTrcQ==", "_location": "/libnpmhook/npm-registry-fetch/make-fetch-happen", "_phantomChildren": { - "json-parse-better-errors": "1.0.1", - "retry": "0.10.1", + "json-parse-better-errors": "1.0.2", "safe-buffer": "5.1.1" }, "_requested": { - "type": "version", + "type": "range", "registry": true, - "raw": "make-fetch-happen@3.0.0", + "raw": "make-fetch-happen@^4.0.0", "name": "make-fetch-happen", "escapedName": "make-fetch-happen", - "rawSpec": "3.0.0", + "rawSpec": "^4.0.0", "saveSpec": null, - "fetchSpec": "3.0.0" + "fetchSpec": "^4.0.0" }, "_requiredBy": [ "/libnpmhook/npm-registry-fetch" ], - "_resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-3.0.0.tgz", - "_spec": "3.0.0", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-4.0.1.tgz", + "_shasum": "141497cb878f243ba93136c83d8aba12c216c083", + "_spec": "make-fetch-happen@^4.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/libnpmhook/node_modules/npm-registry-fetch", "author": { "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" + "email": "kzm@zkat.tech" }, "bugs": { "url": "https://github.com/zkat/make-fetch-happen/issues" }, + "bundleDependencies": false, "dependencies": { "agentkeepalive": "^3.4.1", - "cacache": "^10.0.4", + "cacache": "^11.0.1", "http-cache-semantics": "^3.8.1", "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^2.2.0", + "https-proxy-agent": "^2.2.1", "lru-cache": "^4.1.2", "mississippi": "^3.0.0", "node-fetch-npm": "^2.0.2", "promise-retry": "^1.1.1", - "socks-proxy-agent": "^3.0.1", - "ssri": "^5.2.4" + "socks-proxy-agent": "^4.0.0", + "ssri": "^6.0.0" }, + "deprecated": false, "description": "Opinionated, caching, retrying fetch client", "devDependencies": { "bluebird": "^3.5.1", "mkdirp": "^0.5.1", "nock": "^9.2.3", "npmlog": "^4.1.2", - "nyc": "^11.4.1", "require-inject": "^1.4.2", "rimraf": "^2.6.2", "safe-buffer": "^5.1.1", - "standard": "^11.0.0", + "standard": "^11.0.1", "standard-version": "^4.3.0", "tacks": "^1.2.6", - "tap": "^11.1.2", + "tap": "^11.1.3", "weallbehave": "^1.0.0", "weallcontribute": "^1.0.7" }, @@ -94,9 +89,9 @@ "prerelease": "npm t", "pretest": "standard", "release": "standard-version -s", - "test": "nyc --all -- tap --timeout=35 -J test/*.js", + "test": "tap --coverage --nyc-arg=--all --timeout=35 -J test/*.js", "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "3.0.0" + "version": "4.0.1" } diff --git a/node_modules/libnpmhook/node_modules/npm-registry-fetch/package.json b/node_modules/libnpmhook/node_modules/npm-registry-fetch/package.json index 16bca2902..4ec3a54a1 100644 --- a/node_modules/libnpmhook/node_modules/npm-registry-fetch/package.json +++ b/node_modules/libnpmhook/node_modules/npm-registry-fetch/package.json @@ -1,40 +1,34 @@ { - "_args": [ - [ - "npm-registry-fetch@1.1.0", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_from": "npm-registry-fetch@1.1.0", - "_id": "npm-registry-fetch@1.1.0", + "_from": "npm-registry-fetch@^3.0.0", + "_id": "npm-registry-fetch@3.1.1", "_inBundle": false, - "_integrity": "sha512-XJPIBfMtgaooRtZmuA42xCeLf3tkxdIX0xqRsGWwNrcVvJ9UYFccD7Ho7QWCzvkM3i/QrkUC37Hu0a+vDBmt5g==", + "_integrity": "sha512-xBobENeenvjIG8PgQ1dy77AXTI25IbYhmA3DusMIfw/4EL5BaQ5e1V9trkPrqHvyjR3/T0cnH6o0Wt/IzcI5Ag==", "_location": "/libnpmhook/npm-registry-fetch", "_phantomChildren": { - "cacache": "10.0.4", - "json-parse-better-errors": "1.0.1", + "cacache": "11.0.1", + "json-parse-better-errors": "1.0.2", "lru-cache": "4.1.2", "mississippi": "3.0.0", - "retry": "0.10.1", "safe-buffer": "5.1.1", - "ssri": "5.3.0" + "ssri": "6.0.0" }, "_requested": { - "type": "version", + "type": "range", "registry": true, - "raw": "npm-registry-fetch@1.1.0", + "raw": "npm-registry-fetch@^3.0.0", "name": "npm-registry-fetch", "escapedName": "npm-registry-fetch", - "rawSpec": "1.1.0", + "rawSpec": "^3.0.0", "saveSpec": null, - "fetchSpec": "1.1.0" + "fetchSpec": "^3.0.0" }, "_requiredBy": [ "/libnpmhook" ], - "_resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-1.1.0.tgz", - "_spec": "1.1.0", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-3.1.1.tgz", + "_shasum": "e96bae698afdd45d4a01aca29e881fc0bc55206c", + "_spec": "npm-registry-fetch@^3.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/libnpmhook", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" @@ -42,6 +36,7 @@ "bugs": { "url": "https://github.com/npm/registry-fetch/issues" }, + "bundleDependencies": false, "config": { "nyc": { "exclude": [ @@ -52,23 +47,23 @@ }, "dependencies": { "bluebird": "^3.5.1", - "figgy-pudding": "^2.0.1", + "figgy-pudding": "^3.1.0", "lru-cache": "^4.1.2", - "make-fetch-happen": "^3.0.0", - "npm-package-arg": "^6.0.0", - "safe-buffer": "^5.1.1" + "make-fetch-happen": "^4.0.0", + "npm-package-arg": "^6.0.0" }, + "deprecated": false, "description": "Fetch-based http client for use with npm registry APIs", "devDependencies": { - "cacache": "^10.0.4", + "cacache": "^11.0.0", "mkdirp": "^0.5.1", "nock": "^9.2.3", "npmlog": "^4.1.2", "rimraf": "^2.6.2", - "ssri": "^5.3.0", + "ssri": "^6.0.0", "standard": "^11.0.1", "standard-version": "^4.2.0", - "tap": "^11.1.2", + "tap": "^11.1.3", "weallbehave": "^1.2.0", "weallcontribute": "^1.0.8" }, @@ -98,5 +93,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "1.1.0" + "version": "3.1.1" } diff --git a/node_modules/libnpmhook/package.json b/node_modules/libnpmhook/package.json index 81acb9abe..0b01d4df9 100644 --- a/node_modules/libnpmhook/package.json +++ b/node_modules/libnpmhook/package.json @@ -1,39 +1,38 @@ { - "_from": "libnpmhook@latest", - "_id": "libnpmhook@3.0.0", + "_from": "libnpmhook@4.0.1", + "_id": "libnpmhook@4.0.1", "_inBundle": false, - "_integrity": "sha512-bRP1o0yIw+AkrEnVblqs12VBoHdMgyVLkcl5EEXyoPFtpDgb8Rhlb8F0SmEpUJAmUNk0+JNAz6QDQVtKkXv4rg==", + "_integrity": "sha512-3qqpfqvBD1712WA6iGe0stkG40WwAeoWcujA6BlC0Be1JArQbqwabnEnZ0CRcD05Tf1fPYJYdCbSfcfedEJCOg==", "_location": "/libnpmhook", "_phantomChildren": { "bluebird": "3.5.1", - "cacache": "10.0.4", - "figgy-pudding": "2.0.1", - "json-parse-better-errors": "1.0.1", + "cacache": "11.0.1", + "figgy-pudding": "3.1.0", + "json-parse-better-errors": "1.0.2", "lru-cache": "4.1.2", "mississippi": "3.0.0", "npm-package-arg": "6.0.0", - "retry": "0.10.1", "safe-buffer": "5.1.1", - "ssri": "5.3.0" + "ssri": "6.0.0" }, "_requested": { - "type": "tag", + "type": "version", "registry": true, - "raw": "libnpmhook@latest", + "raw": "libnpmhook@4.0.1", "name": "libnpmhook", "escapedName": "libnpmhook", - "rawSpec": "latest", + "rawSpec": "4.0.1", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "4.0.1" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/libnpmhook/-/libnpmhook-3.0.0.tgz", - "_shasum": "9ac9081390517d6d6a1f73cfbcf78baec0013251", - "_spec": "libnpmhook@latest", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/libnpmhook/-/libnpmhook-4.0.1.tgz", + "_shasum": "63641654de772cbeb96a88527a7fd5456ec3c2d7", + "_spec": "libnpmhook@4.0.1", + "_where": "/Users/rebecca/code/npm", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" @@ -43,8 +42,8 @@ }, "bundleDependencies": false, "dependencies": { - "figgy-pudding": "^2.0.1", - "npm-registry-fetch": "^1.0.1" + "figgy-pudding": "^3.1.0", + "npm-registry-fetch": "^3.0.0" }, "deprecated": false, "description": "programmatic API for managing npm registry hooks", @@ -52,7 +51,7 @@ "nock": "^9.2.3", "standard": "^11.0.1", "standard-version": "^4.3.0", - "tap": "^11.1.2", + "tap": "^11.1.3", "weallbehave": "^1.2.0", "weallcontribute": "^1.0.8" }, @@ -83,5 +82,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "3.0.0" + "version": "4.0.1" } |