From 7ab6830e7484ab466e5bdb11bd17f8babcb79256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Mon, 22 May 2017 17:50:37 -0700 Subject: pacote@2.7.21 --- node_modules/cacache/CHANGELOG.md | 10 - node_modules/cacache/package.json | 30 +- node_modules/pacote/CHANGELOG.md | 91 +++ node_modules/pacote/lib/fetchers/registry/fetch.js | 19 +- .../node_modules/make-fetch-happen/CHANGELOG.md | 62 ++ .../pacote/node_modules/make-fetch-happen/agent.js | 29 +- .../pacote/node_modules/make-fetch-happen/cache.js | 2 +- .../pacote/node_modules/make-fetch-happen/index.js | 61 +- .../node_modules/humanize-ms/History.md | 5 + .../node_modules/humanize-ms/LICENSE | 17 + .../humanize-ms/node_modules/ms/index.js | 77 ++- .../humanize-ms/node_modules/ms/package.json | 67 +- .../humanize-ms/node_modules/ms/readme.md | 3 +- .../node_modules/humanize-ms/package.json | 17 +- .../agent-base/node_modules/semver/LICENSE~HEAD | 15 - .../node_modules/semver/LICENSE~pacote@2.7.4 | 15 - .../node_modules/debug/CHANGELOG.md | 11 +- .../http-proxy-agent/node_modules/debug/README.md | 2 +- .../node_modules/debug/component.json | 2 +- .../node_modules/debug/node_modules/ms/index.js | 77 ++- .../debug/node_modules/ms/package.json | 67 +- .../node_modules/debug/node_modules/ms/readme.md | 3 +- .../node_modules/debug/package.json | 17 +- .../node_modules/debug/src/browser.js | 8 +- .../node_modules/debug/src/node.js | 7 +- .../agent-base/node_modules/semver/LICENSE~HEAD | 15 - .../node_modules/semver/LICENSE~pacote@2.7.4 | 15 - .../node_modules/debug/CHANGELOG.md | 11 +- .../https-proxy-agent/node_modules/debug/README.md | 2 +- .../node_modules/debug/component.json | 2 +- .../node_modules/debug/node_modules/ms/index.js | 77 ++- .../debug/node_modules/ms/package.json | 67 +- .../node_modules/debug/node_modules/ms/readme.md | 3 +- .../node_modules/debug/package.json | 17 +- .../node_modules/debug/src/browser.js | 8 +- .../node_modules/debug/src/node.js | 7 +- .../node_modules/node-fetch-npm/CHANGELOG.md | 10 + .../json-parse-helpfulerror/.editorconfig | 14 + .../json-parse-helpfulerror/.npmignore | 28 + .../node_modules/json-parse-helpfulerror/LICENSE | 22 + .../node_modules/json-parse-helpfulerror/README.md | 29 + .../node_modules/json-parse-helpfulerror/index.js | 21 + .../node_modules/jju/.npmignore | 9 + .../node_modules/jju/LICENSE | 14 + .../node_modules/jju/README.md | 243 +++++++ .../node_modules/jju/index.js | 32 + .../node_modules/jju/lib/analyze.js | 92 +++ .../node_modules/jju/lib/document.js | 485 +++++++++++++ .../node_modules/jju/lib/parse.js | 765 +++++++++++++++++++++ .../node_modules/jju/lib/stringify.js | 383 +++++++++++ .../node_modules/jju/lib/unicode.js | 71 ++ .../node_modules/jju/lib/utils.js | 46 ++ .../node_modules/jju/package.json | 65 ++ .../node_modules/jju/package.yaml | 46 ++ .../json-parse-helpfulerror/package.json | 63 ++ .../json-parse-helpfulerror/test/test.js | 32 + .../node_modules/node-fetch-npm/package.json | 16 +- .../node_modules/node-fetch-npm/src/body.js | 3 +- .../node_modules/socks-proxy-agent/.travis.yml | 25 +- .../node_modules/socks-proxy-agent/History.md | 10 + .../node_modules/socks-proxy-agent/README.md | 2 +- .../node_modules/socks-proxy-agent/package.json | 15 +- .../socks-proxy-agent/socks-proxy-agent.js | 14 +- .../node_modules/socks-proxy-agent/test/server.crt | 13 - .../node_modules/socks-proxy-agent/test/server.key | 15 - .../socks-proxy-agent/test/ssl-cert-snakeoil.key | 15 + .../socks-proxy-agent/test/ssl-cert-snakeoil.pem | 12 + .../node_modules/socks-proxy-agent/test/test.js | 4 +- .../node_modules/make-fetch-happen/package.json | 31 +- .../pacote/node_modules/safe-buffer/.travis.yml | 7 - .../pacote/node_modules/safe-buffer/LICENSE | 21 - .../pacote/node_modules/safe-buffer/README.md | 581 ---------------- .../pacote/node_modules/safe-buffer/browser.js | 1 - .../pacote/node_modules/safe-buffer/index.js | 58 -- .../pacote/node_modules/safe-buffer/package.json | 68 -- .../pacote/node_modules/safe-buffer/test.js | 99 --- .../tar-fs/node_modules/pump/.npmignore~HEAD | 1 - .../node_modules/pump/.npmignore~pacote@2.7.4 | 1 - node_modules/pacote/package.json | 45 +- 79 files changed, 3154 insertions(+), 1311 deletions(-) create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/LICENSE delete mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~HEAD delete mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~pacote@2.7.4 delete mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~HEAD delete mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~pacote@2.7.4 create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/.editorconfig create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/.npmignore create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/LICENSE create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/README.md create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/index.js create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/README.md create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/index.js create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/unicode.js create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/package.json create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/package.json create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/test/test.js delete mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.crt delete mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.key create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.key create mode 100644 node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.pem delete mode 100644 node_modules/pacote/node_modules/safe-buffer/.travis.yml delete mode 100644 node_modules/pacote/node_modules/safe-buffer/LICENSE delete mode 100644 node_modules/pacote/node_modules/safe-buffer/README.md delete mode 100644 node_modules/pacote/node_modules/safe-buffer/browser.js delete mode 100644 node_modules/pacote/node_modules/safe-buffer/index.js delete mode 100644 node_modules/pacote/node_modules/safe-buffer/package.json delete mode 100644 node_modules/pacote/node_modules/safe-buffer/test.js delete mode 100644 node_modules/pacote/node_modules/tar-fs/node_modules/pump/.npmignore~HEAD delete mode 100644 node_modules/pacote/node_modules/tar-fs/node_modules/pump/.npmignore~pacote@2.7.4 (limited to 'node_modules') diff --git a/node_modules/cacache/CHANGELOG.md b/node_modules/cacache/CHANGELOG.md index 8235212ad..5551ff47a 100644 --- a/node_modules/cacache/CHANGELOG.md +++ b/node_modules/cacache/CHANGELOG.md @@ -2,16 +2,6 @@ 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. - -## [9.2.5](https://github.com/zkat/cacache/compare/v9.2.4...v9.2.5) (2017-05-25) - - -### Bug Fixes - -* **deps:** fix lockfile issues and bump ssri ([84e1d7e](https://github.com/zkat/cacache/commit/84e1d7e)) - - - ## [9.2.4](https://github.com/zkat/cacache/compare/v9.2.3...v9.2.4) (2017-05-24) diff --git a/node_modules/cacache/package.json b/node_modules/cacache/package.json index 3ec9cd176..a3cf9eec5 100644 --- a/node_modules/cacache/package.json +++ b/node_modules/cacache/package.json @@ -1,19 +1,19 @@ { - "_from": "cacache@9.2.5", - "_id": "cacache@9.2.5", + "_from": "cacache@9.2.4", + "_id": "cacache@9.2.4", "_inBundle": false, - "_integrity": "sha512-mURsTvkjbCSFRTdkuPhHUp9sbEHn3AVrvM4mveg/bhlKKYolfRm23TsFUVAssC9p622lwmh7pgpb+H5mSVpYcA==", + "_integrity": "sha512-DkEucrb5TwM6yCLgDfyHWMH3QECt9g0pMGNtuGBrALo/B0FcQSnt8B+DyyuPFqOvSOwSPZgqYD4TK9IKJBUoKg==", "_location": "/cacache", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "cacache@9.2.5", + "raw": "cacache@9.2.4", "name": "cacache", "escapedName": "cacache", - "rawSpec": "9.2.5", + "rawSpec": "9.2.4", "saveSpec": null, - "fetchSpec": "9.2.5" + "fetchSpec": "9.2.4" }, "_requiredBy": [ "#USER", @@ -21,9 +21,9 @@ "/pacote", "/pacote/make-fetch-happen" ], - "_resolved": "https://registry.npmjs.org/cacache/-/cacache-9.2.5.tgz", - "_shasum": "cb401d0e59858532062de1f104097cb40c71c3bf", - "_spec": "cacache@9.2.5", + "_resolved": "https://registry.npmjs.org/cacache/-/cacache-9.2.4.tgz", + "_shasum": "f222f569e6d3e1415ad1ae66969c69ca0fc25955", + "_spec": "cacache@9.2.4", "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Kat Marchán", @@ -56,17 +56,17 @@ } ], "dependencies": { - "bluebird": "^3.5.0", + "bluebird": "^3.4.7", "chownr": "^1.0.1", "glob": "^7.1.2", - "graceful-fs": "^4.1.11", + "graceful-fs": "^4.1.10", "lru-cache": "^4.0.2", - "mississippi": "^1.3.0", + "mississippi": "^1.2.0", "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", + "move-concurrently": "^1.0.0", "promise-inflight": "^1.0.1", "rimraf": "^2.6.1", - "ssri": "^4.1.3", + "ssri": "^4.1.2", "unique-filename": "^1.1.0", "y18n": "^3.2.1" }, @@ -125,5 +125,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": "9.2.5" + "version": "9.2.4" } diff --git a/node_modules/pacote/CHANGELOG.md b/node_modules/pacote/CHANGELOG.md index 4c24dd4be..55c0cda68 100644 --- a/node_modules/pacote/CHANGELOG.md +++ b/node_modules/pacote/CHANGELOG.md @@ -2,6 +2,97 @@ 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. + +## [2.7.21](https://github.com/zkat/pacote/compare/v2.7.20...v2.7.21) (2017-05-25) + + +### Bug Fixes + +* **registry:** stop URIEncoding username/password ([011c9a2](https://github.com/zkat/pacote/commit/011c9a2)) + + + + +## [2.7.20](https://github.com/zkat/pacote/compare/v2.7.19...v2.7.20) (2017-05-25) + + +### Bug Fixes + +* **registry:** encode username and password for auth ([c48b651](https://github.com/zkat/pacote/commit/c48b651)) + + + + +## [2.7.19](https://github.com/zkat/pacote/compare/v2.7.18...v2.7.19) (2017-05-25) + + +### Bug Fixes + +* **registry:** respect alwaysAuth ([150788a](https://github.com/zkat/pacote/commit/150788a)) + + + + +## [2.7.18](https://github.com/zkat/pacote/compare/v2.7.17...v2.7.18) (2017-05-25) + + +### Bug Fixes + +* **cache:** pass uid/gid settings through to mfh ([d8845df](https://github.com/zkat/pacote/commit/d8845df)) +* **deps:** update m-f-h for cache opts fix ([faab6cd](https://github.com/zkat/pacote/commit/faab6cd)) + + + + +## [2.7.17](https://github.com/zkat/pacote/compare/v2.7.16...v2.7.17) (2017-05-25) + + +### Bug Fixes + +* **deps:** bump cacache ([34bd656](https://github.com/zkat/pacote/commit/34bd656)) + + + + +## [2.7.16](https://github.com/zkat/pacote/compare/v2.7.15...v2.7.16) (2017-05-24) + + +### Bug Fixes + +* **deps:** pull in various fixes from deps ([4354703](https://github.com/zkat/pacote/commit/4354703)) + + + + +## [2.7.15](https://github.com/zkat/pacote/compare/v2.7.14...v2.7.15) (2017-05-24) + + +### Bug Fixes + +* **proxy:** bump m-f-h with more patches ([26d4170](https://github.com/zkat/pacote/commit/26d4170)) + + + + +## [2.7.14](https://github.com/zkat/pacote/compare/v2.7.13...v2.7.14) (2017-05-24) + + +### Bug Fixes + +* **proxy:** pull in new m-f-h with fixed http proxies ([d6a14e0](https://github.com/zkat/pacote/commit/d6a14e0)) + + + + +## [2.7.13](https://github.com/zkat/pacote/compare/v2.7.12...v2.7.13) (2017-05-23) + + +### Bug Fixes + +* **deps:** bump dep versions to fix http redirect issues ([b23a9fa](https://github.com/zkat/pacote/commit/b23a9fa)) + + + ## [2.7.12](https://github.com/zkat/pacote/compare/v2.7.11...v2.7.12) (2017-05-16) diff --git a/node_modules/pacote/lib/fetchers/registry/fetch.js b/node_modules/pacote/lib/fetchers/registry/fetch.js index 914053c79..46a926a1a 100644 --- a/node_modules/pacote/lib/fetchers/registry/fetch.js +++ b/node_modules/pacote/lib/fetchers/registry/fetch.js @@ -1,5 +1,6 @@ 'use strict' +const BB = require('bluebird') const Buffer = require('safe-buffer').Buffer const checkWarnings = require('./check-warning-header') @@ -19,10 +20,13 @@ function regFetch (uri, registry, opts) { integrity: opts.integrity, memoize: opts.memoize, noProxy: opts.noProxy, + Promise: BB, proxy: opts.proxy, referer: opts.refer, retry: opts.retry, - timeout: opts.timeout + timeout: opts.timeout, + uid: opts.uid, + gid: opts.gid }).then(res => { if (res.headers.has('npm-notice') && !res.headers.has('x-local-cache')) { opts.log.warn('notice', res.headers.get('npm-notice')) @@ -75,14 +79,17 @@ function getHeaders (uri, registry, opts) { }, opts.headers) const auth = ( opts.auth && - // If these two are on different hosts, don't send credentials. - // This is mainly used by the tarball fetcher. - url.parse(uri).host === url.parse(registry).host && opts.auth[registryKey(registry)] ) - if (auth && auth.token) { + // If a tarball is hosted on a different place than the manifest, only send + // credentials on `alwaysAuth` + const shouldAuth = auth && ( + auth.alwaysAuth || + url.parse(uri).host === url.parse(registry).host + ) + if (shouldAuth && auth.token) { headers.authorization = `Bearer ${auth.token}` - } else if (auth && opts.alwaysAuth && auth.username && auth.password) { + } else if (shouldAuth && auth.username && auth.password) { const encoded = Buffer.from( `${auth.username}:${auth.password}`, 'utf8' ).toString('base64') diff --git a/node_modules/pacote/node_modules/make-fetch-happen/CHANGELOG.md b/node_modules/pacote/node_modules/make-fetch-happen/CHANGELOG.md index 0164c37d8..854388027 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/CHANGELOG.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/CHANGELOG.md @@ -2,6 +2,68 @@ 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. + +## [2.4.9](https://github.com/zkat/make-fetch-happen/compare/v2.4.8...v2.4.9) (2017-05-25) + + +### Bug Fixes + +* **cache:** use the passed-in promise for resolving cache stuff ([4c46257](https://github.com/zkat/make-fetch-happen/commit/4c46257)) + + + + +## [2.4.8](https://github.com/zkat/make-fetch-happen/compare/v2.4.7...v2.4.8) (2017-05-25) + + +### Bug Fixes + +* **cache:** pass uid/gid/Promise through to cache ([a847c92](https://github.com/zkat/make-fetch-happen/commit/a847c92)) + + + + +## [2.4.7](https://github.com/zkat/make-fetch-happen/compare/v2.4.6...v2.4.7) (2017-05-24) + + +### Bug Fixes + +* **deps:** pull in various fixes from deps ([fc2a587](https://github.com/zkat/make-fetch-happen/commit/fc2a587)) + + + + +## [2.4.6](https://github.com/zkat/make-fetch-happen/compare/v2.4.5...v2.4.6) (2017-05-24) + + +### Bug Fixes + +* **proxy:** choose agent for http(s)-proxy by protocol of destUrl ([ea4832a](https://github.com/zkat/make-fetch-happen/commit/ea4832a)) +* **proxy:** make socks proxy working ([1de810a](https://github.com/zkat/make-fetch-happen/commit/1de810a)) +* **proxy:** revert previous proxy solution ([563b0d8](https://github.com/zkat/make-fetch-happen/commit/563b0d8)) + + + + +## [2.4.5](https://github.com/zkat/make-fetch-happen/compare/v2.4.4...v2.4.5) (2017-05-24) + + +### Bug Fixes + +* **proxy:** use the destination url when determining agent ([1a714e7](https://github.com/zkat/make-fetch-happen/commit/1a714e7)) + + + + +## [2.4.4](https://github.com/zkat/make-fetch-happen/compare/v2.4.3...v2.4.4) (2017-05-23) + + +### Bug Fixes + +* **redirect:** handle redirects explicitly (#27) ([4c4af54](https://github.com/zkat/make-fetch-happen/commit/4c4af54)) + + + ## [2.4.3](https://github.com/zkat/make-fetch-happen/compare/v2.4.2...v2.4.3) (2017-05-06) diff --git a/node_modules/pacote/node_modules/make-fetch-happen/agent.js b/node_modules/pacote/node_modules/make-fetch-happen/agent.js index fb97208a0..010049894 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/agent.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/agent.js @@ -34,7 +34,7 @@ function getAgent (uri, opts) { } if (pxuri) { - const proxy = getProxy(pxuri, opts) + const proxy = getProxy(pxuri, opts, isHttps) AGENT_CACHE.set(key, proxy) return proxy } @@ -120,7 +120,7 @@ function getProxyUri (uri, opts) { let HttpProxyAgent let HttpsProxyAgent let SocksProxyAgent -function getProxy (proxyUrl, opts) { +function getProxy (proxyUrl, opts, isHttps) { let popts = { host: proxyUrl.hostname, port: proxyUrl.port, @@ -134,21 +134,22 @@ function getProxy (proxyUrl, opts) { rejectUnauthorized: opts.strictSSL } - if (proxyUrl.protocol === 'http:') { - if (!HttpProxyAgent) { - HttpProxyAgent = require('http-proxy-agent') - } + if (proxyUrl.protocol === 'http:' || proxyUrl.protocol === 'https:') { + if (!isHttps) { + if (!HttpProxyAgent) { + HttpProxyAgent = require('http-proxy-agent') + } - return new HttpProxyAgent(popts) - } - if (proxyUrl.protocol === 'https:') { - if (!HttpsProxyAgent) { - HttpsProxyAgent = require('https-proxy-agent') - } + return new HttpProxyAgent(popts) + } else { + if (!HttpsProxyAgent) { + HttpsProxyAgent = require('https-proxy-agent') + } - return new HttpsProxyAgent(popts) + return new HttpsProxyAgent(popts) + } } - if (proxyUrl.startsWith('socks')) { + if (proxyUrl.protocol.startsWith('socks')) { if (!SocksProxyAgent) { SocksProxyAgent = require('socks-proxy-agent') } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/cache.js b/node_modules/pacote/node_modules/make-fetch-happen/cache.js index 85d755e8a..9aeae6b2f 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/cache.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/cache.js @@ -95,7 +95,7 @@ module.exports = class Cache { } }) } - return Promise.resolve(new fetch.Response(body, { + return this.Promise.resolve(new fetch.Response(body, { url: req.url, headers: resHeaders, status: 200, diff --git a/node_modules/pacote/node_modules/make-fetch-happen/index.js b/node_modules/pacote/node_modules/make-fetch-happen/index.js index 1eadece3c..18a289353 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/index.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/index.js @@ -1,6 +1,7 @@ 'use strict' let Cache +const url = require('url') const CachePolicy = require('http-cache-semantics') const fetch = require('node-fetch-npm') const pkg = require('./package.json') @@ -10,6 +11,7 @@ const Stream = require('stream') const getAgent = require('./agent') const setWarning = require('./warning') +const isURL = /^https?:/ const USER_AGENT = `${pkg.name}/${pkg.version} (+https://npm.im/${pkg.name})` const RETRY_ERRORS = [ @@ -50,7 +52,7 @@ function initializeCache (opts) { Cache = require('./cache') } - opts.cacheManager = new Cache(opts.cacheManager) + opts.cacheManager = new Cache(opts.cacheManager, opts) } opts.cache = opts.cache || 'default' @@ -303,8 +305,9 @@ function remoteFetch (uri, opts) { follow: opts.follow, headers: new fetch.Headers(headers), method: opts.method, - redirect: opts.redirect, + redirect: 'manual', size: opts.size, + counter: opts.counter, timeout: opts.timeout } @@ -357,7 +360,59 @@ function remoteFetch (uri, opts) { return retryHandler(res) } - return res + if (!fetch.isRedirect(res.status) || opts.redirect === 'manual') { + return res + } + + // handle redirects - matches behavior of npm-fetch: https://github.com/bitinn/node-fetch + if (opts.redirect === 'error') { + const err = new Error(`redirect mode is set to error: ${uri}`) + err.code = 'ENOREDIRECT' + throw err + } + + if (!res.headers.get('location')) { + const err = new Error(`redirect location header missing at: ${uri}`) + err.code = 'EINVALIDREDIRECT' + throw err + } + + if (req.counter >= req.follow) { + const err = new Error(`maximum redirect reached at: ${uri}`) + err.code = 'EMAXREDIRECT' + throw err + } + + const resolvedUrl = url.resolve(req.url, res.headers.get('location')) + let redirectURL = url.parse(resolvedUrl) + + if (isURL.test(res.headers.get('location'))) { + redirectURL = url.parse(res.headers.get('location')) + } + + // Remove authorization if changing hostnames (but not if just + // changing ports or protocols). This matches the behavior of request: + // https://github.com/request/request/blob/b12a6245/lib/redirect.js#L134-L138 + if (url.parse(req.url).hostname !== redirectURL.hostname) { + req.headers.delete('authorization') + } + + // for POST request with 301/302 response, or any request with 303 response, + // use GET when following redirect + if (res.status === 303 || + ((res.status === 301 || res.status === 302) && req.method === 'POST')) { + opts.method = 'GET' + opts.body = null + req.headers.delete('content-length') + } + + opts.headers = {} + req.headers.forEach((value, name) => { + opts.headers[name] = value + }) + + opts.counter = ++req.counter + return cachingFetch(resolvedUrl, opts) }) .catch(err => { const code = err.code === 'EPROMISERETRY' ? err.retried.code : err.code diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/History.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/History.md index b1729dbc7..b15958705 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/History.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/History.md @@ -1,4 +1,9 @@ +1.2.1 / 2017-05-19 +================== + + * fix: package.json to reduce vulnerabilities (#3) + 1.2.0 / 2016-05-21 ================== diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/LICENSE b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/LICENSE new file mode 100644 index 000000000..89de35479 --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/LICENSE @@ -0,0 +1,17 @@ +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/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/node_modules/ms/index.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/node_modules/ms/index.js index e904c7054..6a522b16b 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/node_modules/ms/index.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/node_modules/ms/index.js @@ -2,11 +2,11 @@ * Helpers. */ -var s = 1000 -var m = s * 60 -var h = m * 60 -var d = h * 24 -var y = d * 365.25 +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; /** * Parse or format the given `val`. @@ -22,18 +22,19 @@ var y = d * 365.25 * @api public */ -module.exports = function (val, options) { - options = options || {} - var type = typeof val +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; if (type === 'string' && val.length > 0) { - return parse(val) + return parse(val); } else if (type === 'number' && isNaN(val) === false) { - return options.long ? - fmtLong(val) : - fmtShort(val) + return options.long ? fmtLong(val) : fmtShort(val); } - throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)) -} + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; /** * Parse the given `str` and return milliseconds. @@ -44,53 +45,55 @@ module.exports = function (val, options) { */ function parse(str) { - str = String(str) - if (str.length > 10000) { - return + str = String(str); + if (str.length > 100) { + return; } - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str) + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); if (!match) { - return + return; } - var n = parseFloat(match[1]) - var type = (match[2] || 'ms').toLowerCase() + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': - return n * y + return n * y; case 'days': case 'day': case 'd': - return n * d + return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': - return n * h + return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': - return n * m + return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': - return n * s + return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': - return n + return n; default: - return undefined + return undefined; } } @@ -104,18 +107,18 @@ function parse(str) { function fmtShort(ms) { if (ms >= d) { - return Math.round(ms / d) + 'd' + return Math.round(ms / d) + 'd'; } if (ms >= h) { - return Math.round(ms / h) + 'h' + return Math.round(ms / h) + 'h'; } if (ms >= m) { - return Math.round(ms / m) + 'm' + return Math.round(ms / m) + 'm'; } if (ms >= s) { - return Math.round(ms / s) + 's' + return Math.round(ms / s) + 's'; } - return ms + 'ms' + return ms + 'ms'; } /** @@ -131,7 +134,7 @@ function fmtLong(ms) { plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || - ms + ' ms' + ms + ' ms'; } /** @@ -140,10 +143,10 @@ function fmtLong(ms) { function plural(ms, n, name) { if (ms < n) { - return + return; } if (ms < n * 1.5) { - return Math.floor(ms / n) + ' ' + name + return Math.floor(ms / n) + ' ' + name; } - return Math.ceil(ms / n) + ' ' + name + 's' + return Math.ceil(ms / n) + ' ' + name + 's'; } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/node_modules/ms/package.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/node_modules/ms/package.json index 186ca293c..5bf17fa25 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/node_modules/ms/package.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/node_modules/ms/package.json @@ -1,72 +1,69 @@ { - "_from": "ms@~0.7.0", - "_id": "ms@0.7.3", - "_integrity": "sha1-cIFVpeROM/X9D8U+gdDUCpG+H/8=", + "_from": "ms@^2.0.0", + "_id": "ms@2.0.0", + "_inBundle": false, + "_integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "_location": "/pacote/make-fetch-happen/agentkeepalive/humanize-ms/ms", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "ms@~0.7.0", + "raw": "ms@^2.0.0", "name": "ms", "escapedName": "ms", - "rawSpec": "~0.7.0", + "rawSpec": "^2.0.0", "saveSpec": null, - "fetchSpec": "~0.7.0" + "fetchSpec": "^2.0.0" }, "_requiredBy": [ "/pacote/make-fetch-happen/agentkeepalive/humanize-ms" ], - "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.3.tgz", - "_shasum": "708155a5e44e33f5fd0fc53e81d0d40a91be1fff", - "_shrinkwrap": null, - "_spec": "ms@~0.7.0", + "_resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "_shasum": "5608aeadfc00be6c2901df5f9861788de0d597c8", + "_spec": "ms@^2.0.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms", - "bin": null, "bugs": { "url": "https://github.com/zeit/ms/issues" }, "bundleDependencies": false, - "component": { - "scripts": { - "ms/index.js": "index.js" - } - }, - "dependencies": {}, "deprecated": false, "description": "Tiny milisecond conversion utility", "devDependencies": { + "eslint": "3.19.0", "expect.js": "0.3.1", - "mocha": "3.0.2", - "serve": "5.0.1", - "xo": "0.17.0" + "husky": "0.13.3", + "lint-staged": "3.4.1", + "mocha": "3.4.1" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } }, "files": [ "index.js" ], "homepage": "https://github.com/zeit/ms#readme", "license": "MIT", + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, "main": "./index", "name": "ms", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git+https://github.com/zeit/ms.git" }, "scripts": { - "test": "xo && mocha test/index.js", - "test-browser": "serve ./test" + "lint": "eslint lib/* bin/*", + "precommit": "lint-staged", + "test": "mocha tests.js" }, - "version": "0.7.3", - "xo": { - "space": true, - "semicolon": false, - "envs": [ - "mocha" - ], - "rules": { - "complexity": 0 - } - } + "version": "2.0.0" } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/node_modules/ms/readme.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/node_modules/ms/readme.md index 5b475707d..84a9974cc 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/node_modules/ms/readme.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/node_modules/ms/readme.md @@ -1,8 +1,7 @@ # ms [![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) -[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) -[![Slack Channel](https://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) +[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) Use this package to easily convert various time formats to milliseconds. diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/package.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/package.json index a10e71dd9..14ea394c4 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/package.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/node_modules/humanize-ms/package.json @@ -1,7 +1,8 @@ { "_from": "humanize-ms@^1.2.0", - "_id": "humanize-ms@1.2.0", - "_integrity": "sha1-TWkaH6G4eYl4mvjljN39VQYi5NQ=", + "_id": "humanize-ms@1.2.1", + "_inBundle": false, + "_integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", "_location": "/pacote/make-fetch-happen/agentkeepalive/humanize-ms", "_phantomChildren": {}, "_requested": { @@ -17,9 +18,8 @@ "_requiredBy": [ "/pacote/make-fetch-happen/agentkeepalive" ], - "_resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.0.tgz", - "_shasum": "4d691a1fa1b87989789af8e58cddfd550622e4d4", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "_shasum": "c46e3159a293f6b896da29316d8b6fe8bb79bbed", "_spec": "humanize-ms@^1.2.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive", "author": { @@ -27,13 +27,12 @@ "email": "dead_horse@qq.com", "url": "http://deadhorse.me" }, - "bin": null, "bugs": { "url": "https://github.com/node-modules/humanize-ms/issues" }, "bundleDependencies": false, "dependencies": { - "ms": "~0.7.0" + "ms": "^2.0.0" }, "deprecated": false, "description": "transform humanize time to ms", @@ -56,8 +55,6 @@ "license": "MIT", "main": "index.js", "name": "humanize-ms", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git+https://github.com/node-modules/humanize-ms.git" @@ -65,5 +62,5 @@ "scripts": { "test": "make test" }, - "version": "1.2.0" + "version": "1.2.1" } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~HEAD b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~HEAD deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~HEAD +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~pacote@2.7.4 b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~pacote@2.7.4 deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~pacote@2.7.4 +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/CHANGELOG.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/CHANGELOG.md index 93580f1cc..a1a270cd4 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/CHANGELOG.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/CHANGELOG.md @@ -1,8 +1,15 @@ -2.6.6 / 2017-04-27 +2.6.8 / 2017-05-18 ================== - * Fix: regression from removal of undefined check (@thebigredgeek) + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) 2.6.5 / 2017-04-27 ================== diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/README.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/README.md index 4aeab13f1..f67be6b31 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/README.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/README.md @@ -100,7 +100,7 @@ Then, run the program to be debugged as usual. | Name | Purpose | |-----------|-------------------------------------------------| -| `DEBUG` | Enables/disabled specific debugging namespaces. | +| `DEBUG` | Enables/disables specific debugging namespaces. | | `DEBUG_COLORS`| Whether or not to use colors in the debug output. | | `DEBUG_DEPTH` | Object inspection depth. | | `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/component.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/component.json index 0705b91aa..94cd36d8b 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/component.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/component.json @@ -2,7 +2,7 @@ "name": "debug", "repo": "visionmedia/debug", "description": "small debugging utility", - "version": "2.6.6", + "version": "2.6.8", "keywords": [ "debug", "log", diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/node_modules/ms/index.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/node_modules/ms/index.js index e904c7054..6a522b16b 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/node_modules/ms/index.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/node_modules/ms/index.js @@ -2,11 +2,11 @@ * Helpers. */ -var s = 1000 -var m = s * 60 -var h = m * 60 -var d = h * 24 -var y = d * 365.25 +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; /** * Parse or format the given `val`. @@ -22,18 +22,19 @@ var y = d * 365.25 * @api public */ -module.exports = function (val, options) { - options = options || {} - var type = typeof val +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; if (type === 'string' && val.length > 0) { - return parse(val) + return parse(val); } else if (type === 'number' && isNaN(val) === false) { - return options.long ? - fmtLong(val) : - fmtShort(val) + return options.long ? fmtLong(val) : fmtShort(val); } - throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)) -} + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; /** * Parse the given `str` and return milliseconds. @@ -44,53 +45,55 @@ module.exports = function (val, options) { */ function parse(str) { - str = String(str) - if (str.length > 10000) { - return + str = String(str); + if (str.length > 100) { + return; } - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str) + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); if (!match) { - return + return; } - var n = parseFloat(match[1]) - var type = (match[2] || 'ms').toLowerCase() + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': - return n * y + return n * y; case 'days': case 'day': case 'd': - return n * d + return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': - return n * h + return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': - return n * m + return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': - return n * s + return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': - return n + return n; default: - return undefined + return undefined; } } @@ -104,18 +107,18 @@ function parse(str) { function fmtShort(ms) { if (ms >= d) { - return Math.round(ms / d) + 'd' + return Math.round(ms / d) + 'd'; } if (ms >= h) { - return Math.round(ms / h) + 'h' + return Math.round(ms / h) + 'h'; } if (ms >= m) { - return Math.round(ms / m) + 'm' + return Math.round(ms / m) + 'm'; } if (ms >= s) { - return Math.round(ms / s) + 's' + return Math.round(ms / s) + 's'; } - return ms + 'ms' + return ms + 'ms'; } /** @@ -131,7 +134,7 @@ function fmtLong(ms) { plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || - ms + ' ms' + ms + ' ms'; } /** @@ -140,10 +143,10 @@ function fmtLong(ms) { function plural(ms, n, name) { if (ms < n) { - return + return; } if (ms < n * 1.5) { - return Math.floor(ms / n) + ' ' + name + return Math.floor(ms / n) + ' ' + name; } - return Math.ceil(ms / n) + ' ' + name + 's' + return Math.ceil(ms / n) + ' ' + name + 's'; } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/node_modules/ms/package.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/node_modules/ms/package.json index 28311e8bd..6c1e6fc3c 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/node_modules/ms/package.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/node_modules/ms/package.json @@ -1,72 +1,69 @@ { - "_from": "ms@0.7.3", - "_id": "ms@0.7.3", - "_integrity": "sha1-cIFVpeROM/X9D8U+gdDUCpG+H/8=", + "_from": "ms@2.0.0", + "_id": "ms@2.0.0", + "_inBundle": false, + "_integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "_location": "/pacote/make-fetch-happen/http-proxy-agent/debug/ms", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "ms@0.7.3", + "raw": "ms@2.0.0", "name": "ms", "escapedName": "ms", - "rawSpec": "0.7.3", + "rawSpec": "2.0.0", "saveSpec": null, - "fetchSpec": "0.7.3" + "fetchSpec": "2.0.0" }, "_requiredBy": [ "/pacote/make-fetch-happen/http-proxy-agent/debug" ], - "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.3.tgz", - "_shasum": "708155a5e44e33f5fd0fc53e81d0d40a91be1fff", - "_shrinkwrap": null, - "_spec": "ms@0.7.3", + "_resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "_shasum": "5608aeadfc00be6c2901df5f9861788de0d597c8", + "_spec": "ms@2.0.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug", - "bin": null, "bugs": { "url": "https://github.com/zeit/ms/issues" }, "bundleDependencies": false, - "component": { - "scripts": { - "ms/index.js": "index.js" - } - }, - "dependencies": {}, "deprecated": false, "description": "Tiny milisecond conversion utility", "devDependencies": { + "eslint": "3.19.0", "expect.js": "0.3.1", - "mocha": "3.0.2", - "serve": "5.0.1", - "xo": "0.17.0" + "husky": "0.13.3", + "lint-staged": "3.4.1", + "mocha": "3.4.1" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } }, "files": [ "index.js" ], "homepage": "https://github.com/zeit/ms#readme", "license": "MIT", + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, "main": "./index", "name": "ms", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git+https://github.com/zeit/ms.git" }, "scripts": { - "test": "xo && mocha test/index.js", - "test-browser": "serve ./test" + "lint": "eslint lib/* bin/*", + "precommit": "lint-staged", + "test": "mocha tests.js" }, - "version": "0.7.3", - "xo": { - "space": true, - "semicolon": false, - "envs": [ - "mocha" - ], - "rules": { - "complexity": 0 - } - } + "version": "2.0.0" } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/node_modules/ms/readme.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/node_modules/ms/readme.md index 5b475707d..84a9974cc 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/node_modules/ms/readme.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/node_modules/ms/readme.md @@ -1,8 +1,7 @@ # ms [![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) -[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) -[![Slack Channel](https://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) +[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) Use this package to easily convert various time formats to milliseconds. diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/package.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/package.json index dad9ab5dd..1062dd985 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/package.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/package.json @@ -1,7 +1,8 @@ { "_from": "debug@2", - "_id": "debug@2.6.6", - "_integrity": "sha1-qfpvvpykPPHnn3O3XAGJy7fW21o=", + "_id": "debug@2.6.8", + "_inBundle": false, + "_integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", "_location": "/pacote/make-fetch-happen/http-proxy-agent/debug", "_phantomChildren": {}, "_requested": { @@ -17,16 +18,14 @@ "_requiredBy": [ "/pacote/make-fetch-happen/http-proxy-agent" ], - "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.6.tgz", - "_shasum": "a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "_shasum": "e731531ca2ede27d188222427da17821d68ff4fc", "_spec": "debug@2", "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" }, - "bin": null, "browser": "./src/browser.js", "bugs": { "url": "https://github.com/visionmedia/debug/issues" @@ -50,7 +49,7 @@ } ], "dependencies": { - "ms": "0.7.3" + "ms": "2.0.0" }, "deprecated": false, "description": "small debugging utility", @@ -81,11 +80,9 @@ "license": "MIT", "main": "./src/index.js", "name": "debug", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" }, - "version": "2.6.6" + "version": "2.6.8" } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/src/browser.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/src/browser.js index 053f4b898..710692493 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/src/browser.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/src/browser.js @@ -46,14 +46,14 @@ function useColors() { // is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/src/node.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/src/node.js index 3c7407b6b..af6129768 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/src/node.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/debug/src/node.js @@ -231,7 +231,12 @@ function createWritableStdioStream (fd) { */ function init (debug) { - debug.inspectOpts = util._extend({}, exports.inspectOpts); + debug.inspectOpts = {}; + + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } } /** diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~HEAD b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~HEAD deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~HEAD +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~pacote@2.7.4 b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~pacote@2.7.4 deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE~pacote@2.7.4 +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/CHANGELOG.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/CHANGELOG.md index 93580f1cc..a1a270cd4 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/CHANGELOG.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/CHANGELOG.md @@ -1,8 +1,15 @@ -2.6.6 / 2017-04-27 +2.6.8 / 2017-05-18 ================== - * Fix: regression from removal of undefined check (@thebigredgeek) + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) 2.6.5 / 2017-04-27 ================== diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/README.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/README.md index 4aeab13f1..f67be6b31 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/README.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/README.md @@ -100,7 +100,7 @@ Then, run the program to be debugged as usual. | Name | Purpose | |-----------|-------------------------------------------------| -| `DEBUG` | Enables/disabled specific debugging namespaces. | +| `DEBUG` | Enables/disables specific debugging namespaces. | | `DEBUG_COLORS`| Whether or not to use colors in the debug output. | | `DEBUG_DEPTH` | Object inspection depth. | | `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/component.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/component.json index 0705b91aa..94cd36d8b 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/component.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/component.json @@ -2,7 +2,7 @@ "name": "debug", "repo": "visionmedia/debug", "description": "small debugging utility", - "version": "2.6.6", + "version": "2.6.8", "keywords": [ "debug", "log", diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/node_modules/ms/index.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/node_modules/ms/index.js index e904c7054..6a522b16b 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/node_modules/ms/index.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/node_modules/ms/index.js @@ -2,11 +2,11 @@ * Helpers. */ -var s = 1000 -var m = s * 60 -var h = m * 60 -var d = h * 24 -var y = d * 365.25 +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; /** * Parse or format the given `val`. @@ -22,18 +22,19 @@ var y = d * 365.25 * @api public */ -module.exports = function (val, options) { - options = options || {} - var type = typeof val +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; if (type === 'string' && val.length > 0) { - return parse(val) + return parse(val); } else if (type === 'number' && isNaN(val) === false) { - return options.long ? - fmtLong(val) : - fmtShort(val) + return options.long ? fmtLong(val) : fmtShort(val); } - throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)) -} + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; /** * Parse the given `str` and return milliseconds. @@ -44,53 +45,55 @@ module.exports = function (val, options) { */ function parse(str) { - str = String(str) - if (str.length > 10000) { - return + str = String(str); + if (str.length > 100) { + return; } - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str) + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); if (!match) { - return + return; } - var n = parseFloat(match[1]) - var type = (match[2] || 'ms').toLowerCase() + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': - return n * y + return n * y; case 'days': case 'day': case 'd': - return n * d + return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': - return n * h + return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': - return n * m + return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': - return n * s + return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': - return n + return n; default: - return undefined + return undefined; } } @@ -104,18 +107,18 @@ function parse(str) { function fmtShort(ms) { if (ms >= d) { - return Math.round(ms / d) + 'd' + return Math.round(ms / d) + 'd'; } if (ms >= h) { - return Math.round(ms / h) + 'h' + return Math.round(ms / h) + 'h'; } if (ms >= m) { - return Math.round(ms / m) + 'm' + return Math.round(ms / m) + 'm'; } if (ms >= s) { - return Math.round(ms / s) + 's' + return Math.round(ms / s) + 's'; } - return ms + 'ms' + return ms + 'ms'; } /** @@ -131,7 +134,7 @@ function fmtLong(ms) { plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || - ms + ' ms' + ms + ' ms'; } /** @@ -140,10 +143,10 @@ function fmtLong(ms) { function plural(ms, n, name) { if (ms < n) { - return + return; } if (ms < n * 1.5) { - return Math.floor(ms / n) + ' ' + name + return Math.floor(ms / n) + ' ' + name; } - return Math.ceil(ms / n) + ' ' + name + 's' + return Math.ceil(ms / n) + ' ' + name + 's'; } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/node_modules/ms/package.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/node_modules/ms/package.json index e1a8785c3..edaef6e35 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/node_modules/ms/package.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/node_modules/ms/package.json @@ -1,72 +1,69 @@ { - "_from": "ms@0.7.3", - "_id": "ms@0.7.3", - "_integrity": "sha1-cIFVpeROM/X9D8U+gdDUCpG+H/8=", + "_from": "ms@2.0.0", + "_id": "ms@2.0.0", + "_inBundle": false, + "_integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "_location": "/pacote/make-fetch-happen/https-proxy-agent/debug/ms", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "ms@0.7.3", + "raw": "ms@2.0.0", "name": "ms", "escapedName": "ms", - "rawSpec": "0.7.3", + "rawSpec": "2.0.0", "saveSpec": null, - "fetchSpec": "0.7.3" + "fetchSpec": "2.0.0" }, "_requiredBy": [ "/pacote/make-fetch-happen/https-proxy-agent/debug" ], - "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.3.tgz", - "_shasum": "708155a5e44e33f5fd0fc53e81d0d40a91be1fff", - "_shrinkwrap": null, - "_spec": "ms@0.7.3", + "_resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "_shasum": "5608aeadfc00be6c2901df5f9861788de0d597c8", + "_spec": "ms@2.0.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug", - "bin": null, "bugs": { "url": "https://github.com/zeit/ms/issues" }, "bundleDependencies": false, - "component": { - "scripts": { - "ms/index.js": "index.js" - } - }, - "dependencies": {}, "deprecated": false, "description": "Tiny milisecond conversion utility", "devDependencies": { + "eslint": "3.19.0", "expect.js": "0.3.1", - "mocha": "3.0.2", - "serve": "5.0.1", - "xo": "0.17.0" + "husky": "0.13.3", + "lint-staged": "3.4.1", + "mocha": "3.4.1" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } }, "files": [ "index.js" ], "homepage": "https://github.com/zeit/ms#readme", "license": "MIT", + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, "main": "./index", "name": "ms", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git+https://github.com/zeit/ms.git" }, "scripts": { - "test": "xo && mocha test/index.js", - "test-browser": "serve ./test" + "lint": "eslint lib/* bin/*", + "precommit": "lint-staged", + "test": "mocha tests.js" }, - "version": "0.7.3", - "xo": { - "space": true, - "semicolon": false, - "envs": [ - "mocha" - ], - "rules": { - "complexity": 0 - } - } + "version": "2.0.0" } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/node_modules/ms/readme.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/node_modules/ms/readme.md index 5b475707d..84a9974cc 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/node_modules/ms/readme.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/node_modules/ms/readme.md @@ -1,8 +1,7 @@ # ms [![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) -[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) -[![Slack Channel](https://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) +[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) Use this package to easily convert various time formats to milliseconds. diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/package.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/package.json index 49f3bb4fd..ac0f1e8a9 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/package.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/package.json @@ -1,7 +1,8 @@ { "_from": "debug@2", - "_id": "debug@2.6.6", - "_integrity": "sha1-qfpvvpykPPHnn3O3XAGJy7fW21o=", + "_id": "debug@2.6.8", + "_inBundle": false, + "_integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", "_location": "/pacote/make-fetch-happen/https-proxy-agent/debug", "_phantomChildren": {}, "_requested": { @@ -17,16 +18,14 @@ "_requiredBy": [ "/pacote/make-fetch-happen/https-proxy-agent" ], - "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.6.tgz", - "_shasum": "a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "_shasum": "e731531ca2ede27d188222427da17821d68ff4fc", "_spec": "debug@2", "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" }, - "bin": null, "browser": "./src/browser.js", "bugs": { "url": "https://github.com/visionmedia/debug/issues" @@ -50,7 +49,7 @@ } ], "dependencies": { - "ms": "0.7.3" + "ms": "2.0.0" }, "deprecated": false, "description": "small debugging utility", @@ -81,11 +80,9 @@ "license": "MIT", "main": "./src/index.js", "name": "debug", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" }, - "version": "2.6.6" + "version": "2.6.8" } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/src/browser.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/src/browser.js index 053f4b898..710692493 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/src/browser.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/src/browser.js @@ -46,14 +46,14 @@ function useColors() { // is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/src/node.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/src/node.js index 3c7407b6b..af6129768 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/src/node.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/src/node.js @@ -231,7 +231,12 @@ function createWritableStdioStream (fd) { */ function init (debug) { - debug.inspectOpts = util._extend({}, exports.inspectOpts); + debug.inspectOpts = {}; + + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } } /** diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/CHANGELOG.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/CHANGELOG.md index ec77cdd02..e007b9992 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/CHANGELOG.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/CHANGELOG.md @@ -2,6 +2,16 @@ 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. + +## [2.0.1](https://github.com/npm/node-fetch-npm/compare/v2.0.0...v2.0.1) (2017-05-24) + + +### Bug Fixes + +* **json:** improve JSON parse error reporting ([1c810df](https://github.com/npm/node-fetch-npm/commit/1c810df)) + + + # [2.0.0](https://github.com/npm/node-fetch-npm/compare/v1.0.1...v2.0.0) (2017-05-06) diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/.editorconfig b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/.editorconfig new file mode 100644 index 000000000..fb7f73a83 --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/.editorconfig @@ -0,0 +1,14 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.js, **/*.js] +indent_size = 4 +indent_style = space + +[{package.json,.travis.yml}] +indent_size = 2 +indent_style = space diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/.npmignore b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/.npmignore new file mode 100644 index 000000000..59d842baa --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/.npmignore @@ -0,0 +1,28 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# Commenting this out is preferred by some people, see +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- +node_modules + +# Users Environment Variables +.lock-wscript diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/LICENSE b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/LICENSE new file mode 100644 index 000000000..e637724b3 --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Sam Mikes + +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/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/README.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/README.md new file mode 100644 index 000000000..ffad93584 --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/README.md @@ -0,0 +1,29 @@ +# json-parse-helpfulerror + +A drop-in replacement for `JSON.parse` that uses + to provide more useful error messages in the +event of a parse error. + +# Example + +## Installation + +``` +npm i -S json-parse-helpfulerror +``` + +## Use + +```js +var jph = require('json-parse-helpfulerror'); + +var notJSON = "{'foo': 3}"; // keys must be double-quoted in JSON + +JSON.parse(notJSON); // throws unhelpful error + +jph.parse("{'foo': 3}") // throws more helpful error: "Unexpected token '\''..." +``` + +# License + +MIT \ No newline at end of file diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/index.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/index.js new file mode 100644 index 000000000..15648b017 --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/index.js @@ -0,0 +1,21 @@ +'use strict'; + +var jju = require('jju'); + +function parse(text, reviver) { + try { + return JSON.parse(text, reviver); + } catch (err) { + // we expect this to throw with a more informative message + jju.parse(text, { + mode: 'json', + reviver: reviver + }); + + // backup if jju is not as strict as JSON.parse; re-throw error + // data-dependent code path, I do not know how to cover it + throw err; + } +} + +exports.parse = parse; diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore new file mode 100644 index 000000000..5ae40150e --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore @@ -0,0 +1,9 @@ +package.json +node_modules +test +benchmark +docs +examples +/.editorconfig +/.eslint* +/.travis.yml diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE new file mode 100644 index 000000000..ee7d6a54e --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE @@ -0,0 +1,14 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. + diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/README.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/README.md new file mode 100644 index 000000000..85d52a2dc --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/README.md @@ -0,0 +1,243 @@ +`jju` - a set of utilities to work with JSON / JSON5 documents + +[![npm version badge](https://img.shields.io/npm/v/jju.svg)](https://www.npmjs.org/package/jju) +[![travis badge](http://img.shields.io/travis/rlidwka/jju.svg)](https://travis-ci.org/rlidwka/jju) +[![downloads badge](http://img.shields.io/npm/dm/jju.svg)](https://www.npmjs.org/package/jju) + +## Installation + +``` +npm install jju +``` + +## Usage + +This module provides following functions: + +1. [jju.parse()](#jjuparse-function) parses json/json5 text and returns a javascript value it corresponds to +2. [jju.stringify()](#jjustringify-function) converts javascript value to an appropriate json/json5 text +3. [jju.tokenize()](#jjutokenize-function) parses json/json5 text and returns an array of tokens it consists of ([see demo](http://rlidwka.github.io/jju/tokenizer.html)) +4. [jju.analyze()](#jjuanalyze-function) parses json/json5 text and tries to guess indentation, quoting style, etc. +5. [jju.update()](#jjuupdate-function) changes json/json5 text, preserving original formatting as much as possible ([see demo](http://rlidwka.github.io/jju/editor.html)) + +All functions are able to work with a standard JSON documents. `jju.parse()` and `jju.stringify()` are better in some cases, but slower than native `JSON.parse()` and `JSON.stringify()` versions. Detailed description see below. + +### jju.parse() function + +```javascript +/* + * Main syntax: + * + * `text` - text to parse, type: String + * `options` - parser options, type: Object + */ +jju.parse(text[, options]) + +// compatibility syntax +jju.parse(text[, reviver]) +``` + +Options: + + - reserved\_keys - what to do with reserved keys (String, default="ignore") + - "ignore" - ignore reserved keys + - "throw" - throw SyntaxError in case of reserved keys + - "replace" - replace reserved keys, this is the default JSON.parse behaviour, unsafe + + Reserved keys are keys that exist in an empty object (`hasOwnProperty`, `__proto__`, etc.). + +```javascript +// 'ignore' will cause reserved keys to be ignored: +parse('{hasOwnProperty: 1}', {reserved_keys: 'ignore'}) == {} +parse('{hasOwnProperty: 1, x: 2}', {reserved_keys: 'ignore'}).hasOwnProperty('x') == true + +// 'throw' will cause SyntaxError in these cases: +parse('{hasOwnProperty: 1}', {reserved_keys: 'throw'}) == SyntaxError + +// 'replace' will replace reserved keys with new ones: +parse('{hasOwnProperty: 1}', {reserved_keys: 'throw'}) == {hasOwnProperty: 1} +parse('{hasOwnProperty: 1, x: 2}', {reserved_keys: 'ignore'}).hasOwnProperty('x') == TypeError +``` + + + - null\_prototype - create object as Object.create(null) instead of '{}' (Boolean) + + if `reserved_keys != 'replace'`, default is **false** + + if `reserved_keys == 'replace'`, default is **true** + + It is usually unsafe and not recommended to change this option to false in the last case. + + - reviver - reviver function - Function + + This function should follow JSON specification + + - mode - operation mode, set it to 'json' if you want to throw on non-strict json files (String) + +### jju.stringify() function + +```javascript +/* + * Main syntax: + * + * `value` - value to serialize, type: * + * `options` - serializer options, type: Object + */ +jju.stringify(value[, options]) + +// compatibility syntax +jju.stringify(value[, replacer [, indent]) +``` + +Options: + + - ascii - output ascii only (Boolean, default=false) + If this option is enabled, output will not have any characters except of 0x20-0x7f. + + - indent - indentation (String, Number or Boolean, default='\t') + This option follows JSON specification. + + - quote - enquoting char (String, "'" or '"', default="'") + - quote\_keys - whether keys quoting in objects is required or not (String, default=false) + If you want `{"q": 1}` instead of `{q: 1}`, set it to true. + + - sort\_keys - sort all keys while stringifying (Boolean or Function, default=false) + By default sort order will depend on implementation, with v8 it's insertion order. If set to `true`, all keys (but not arrays) will be sorted alphabetically. You can provide your own sorting function as well. + + - replacer - replacer function or array (Function or Array) + This option follows JSON specification. + + - no\_trailing\_comma = don't output trailing comma (Boolean, default=false) + If this option is set, arrays like this `[1,2,3,]` will never be generated. Otherwise they may be generated for pretty printing. + + - mode - operation mode, set it to 'json' if you want correct json in the output (String) + + Currently it's either 'json' or something else. If it is 'json', following options are implied: + + - options.quote = '"' + - options.no\_trailing\_comma = true + - options.quote\_keys = true + - '\x' literals are not used + +### jju.tokenize() function + +```javascript +/* + * Main syntax: + * + * `text` - text to tokenize, type: String + * `options` - parser options, type: Object + */ +jju.tokenize(text[, options]) +``` + +Options are the same as for the `jju.parse` function. + +Return value is an array of tokens, where each token is an object: + + - raw (String) - raw text of this token, if you join all raw's, you will get the original document + - type (String) - type of the token, can be `whitespace`, `comment`, `key`, `literal`, `separator` or `newline` + - stack (Array) - path to the current token in the syntax tree + - value - value of the token if token is a `key` or `literal` + +You can check tokenizer for yourself using [this demo](http://rlidwka.github.io/jju/tokenizer.html). + +### jju.analyze() function + +```javascript +/* + * Main syntax: + * + * `text` - text to analyze, type: String + * `options` - parser options, type: Object + */ +jju.analyze(text[, options]) +``` + +Options are the same as for the `jju.parse` function. + +Return value is an object defining a programming style in which the document was written. + + - indent (String) - preferred indentation + - newline (String) - preferred newline + - quote (String) - `"` or `'` depending on which quote is preferred + - quote\_keys (Boolean) - `true` if unquoted keys were used at least once + - has\_whitespace (Boolean) - `true` if input has a whitespace token + - has\_comments (Boolean) - `true` if input has a comment token + - has\_newlines (Boolean) - `true` if input has a newline token + - has\_trailing\_comma (Boolean) - `true` if input has at least one trailing comma + +### jju.update() function + +```javascript +/* + * Main syntax: + * + * `text` - original text, type: String + * `new_value` - new value you want to set + * `options` - parser or stringifier options, type: Object + */ +jju.update(text, new_value[, options]) +``` + +If you want to update a JSON document, here is the general approach: + +```javascript +// here is your original JSON document: +var input = '{"foo": "bar", "baz": 123}' + +// you need to parse it first: +var json = jju.parse(input, {mode: 'json'}) +// json is { foo: 'bar', baz: 123 } + +// then you can change it as you like: +json.foo = 'quux' +json.hello = 'world' + +// then you run an update function to change the original json: +var output = jju.update(input, json, {mode: 'json'}) +// output is '{"foo": "quux", "baz": 123, "hello": "world"}' +``` + +Look at [this demo](http://rlidwka.github.io/jju/editor.html) to test various types of json. + +## Advantages over existing JSON libraries + +In a few cases it makes sense to use this module instead of built-in JSON methods. + +Parser: + - better error reporting with source code and line numbers + +In case of syntax error, JSON.parse does not return any good information to the user. This module does: + +``` +$ node -e 'require("jju").parse("[1,1,1,1,invalid]")' + +SyntaxError: Unexpected token 'i' at 0:9 +[1,1,1,1,invalid] + ^ +``` + +This module is about 5 times slower, so if user experience matters to you more than performance, use this module. If you're working with a lot of machine-generated data, use JSON.parse instead. + +Stringifier: + - util.inspect-like pretty printing + +This module behaves more smart when dealing with object and arrays, and does not always print newlines in them: + +``` +$ node -e 'console.log(require("./").stringify([[,,,],,,[,,,,]], {mode:"json"}))' +[ + [null, null, null], + null, + null, + [null, null, null, null] +] +``` + +JSON.stringify will split this into 15 lines, and it's hard to read. + +Yet again, this feature comes with a performance hit, so if user experience matters to you more than performance, use this module. If your JSON will be consumed by machines, use JSON.stringify instead. + +As a rule of thumb, if you use "space" argument to indent your JSON, you'd better use this module instead. + diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/index.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/index.js new file mode 100644 index 000000000..50f162496 --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/index.js @@ -0,0 +1,32 @@ + +module.exports.__defineGetter__('parse', function() { + return require('./lib/parse').parse +}) + +module.exports.__defineGetter__('stringify', function() { + return require('./lib/stringify').stringify +}) + +module.exports.__defineGetter__('tokenize', function() { + return require('./lib/parse').tokenize +}) + +module.exports.__defineGetter__('update', function() { + return require('./lib/document').update +}) + +module.exports.__defineGetter__('analyze', function() { + return require('./lib/analyze').analyze +}) + +module.exports.__defineGetter__('utils', function() { + return require('./lib/utils') +}) + +/**package +{ "name": "jju", + "version": "0.0.0", + "dependencies": {"js-yaml": "*"}, + "scripts": {"postinstall": "js-yaml package.yaml > package.json ; npm install"} +} +**/ diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js new file mode 100644 index 000000000..9b0f9af01 --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js @@ -0,0 +1,92 @@ +/* + * Author: Alex Kocharin + * GIT: https://github.com/rlidwka/jju + * License: WTFPL, grab your copy here: http://www.wtfpl.net/txt/copying/ + */ + +var tokenize = require('./parse').tokenize + +module.exports.analyze = function analyzeJSON(input, options) { + if (options == null) options = {} + + if (!Array.isArray(input)) { + input = tokenize(input, options) + } + + var result = { + has_whitespace: false, + has_comments: false, + has_newlines: false, + has_trailing_comma: false, + indent: '', + newline: '\n', + quote: '"', + quote_keys: true, + } + + var stats = { + indent: {}, + newline: {}, + quote: {}, + } + + for (var i=0; i stats[k][b] ? a : b + }) + } + } + + return result +} + diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js new file mode 100644 index 000000000..cfab8691f --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js @@ -0,0 +1,485 @@ +/* + * Author: Alex Kocharin + * GIT: https://github.com/rlidwka/jju + * License: WTFPL, grab your copy here: http://www.wtfpl.net/txt/copying/ + */ + +var assert = require('assert') +var tokenize = require('./parse').tokenize +var stringify = require('./stringify').stringify +var analyze = require('./analyze').analyze + +function isObject(x) { + return typeof(x) === 'object' && x !== null +} + +function value_to_tokenlist(value, stack, options, is_key, indent) { + options = Object.create(options) + options._stringify_key = !!is_key + + if (indent) { + options._prefix = indent.prefix.map(function(x) { + return x.raw + }).join('') + } + + if (options._splitMin == null) options._splitMin = 0 + if (options._splitMax == null) options._splitMax = 0 + + var stringified = stringify(value, options) + + if (is_key) { + return [ { raw: stringified, type: 'key', stack: stack, value: value } ] + } + + options._addstack = stack + var result = tokenize(stringified, { + _addstack: stack, + }) + result.data = null + return result +} + +// '1.2.3' -> ['1','2','3'] +function arg_to_path(path) { + // array indexes + if (typeof(path) === 'number') path = String(path) + + if (path === '') path = [] + if (typeof(path) === 'string') path = path.split('.') + + if (!Array.isArray(path)) throw Error('Invalid path type, string or array expected') + return path +} + +// returns new [begin, end] or false if not found +// +// {x:3, xxx: 111, y: [111, {q: 1, e: 2} ,333] } +// f('y',0) returns this B^^^^^^^^^^^^^^^^^^^^^^^^E +// then f('1',1) would reduce it to B^^^^^^^^^^E +function find_element_in_tokenlist(element, lvl, tokens, begin, end) { + while(tokens[begin].stack[lvl] != element) { + if (begin++ >= end) return false + } + while(tokens[end].stack[lvl] != element) { + if (end-- < begin) return false + } + return [begin, end] +} + +function is_whitespace(token_type) { + return token_type === 'whitespace' + || token_type === 'newline' + || token_type === 'comment' +} + +function find_first_non_ws_token(tokens, begin, end) { + while(is_whitespace(tokens[begin].type)) { + if (begin++ >= end) return false + } + return begin +} + +function find_last_non_ws_token(tokens, begin, end) { + while(is_whitespace(tokens[end].type)) { + if (end-- < begin) return false + } + return end +} + +/* + * when appending a new element of an object/array, we are trying to + * figure out the style used on the previous element + * + * return {prefix, sep1, sep2, suffix} + * + * ' "key" : "element" \r\n' + * prefix^^^^ sep1^ ^^sep2 ^^^^^^^^suffix + * + * begin - the beginning of the object/array + * end - last token of the last element (value or comma usually) + */ +function detect_indent_style(tokens, is_array, begin, end, level) { + var result = { + sep1: [], + sep2: [], + suffix: [], + prefix: [], + newline: [], + } + + if (tokens[end].type === 'separator' && tokens[end].stack.length !== level+1 && tokens[end].raw !== ',') { + // either a beginning of the array (no last element) or other weird situation + // + // just return defaults + return result + } + + // ' "key" : "value" ,' + // skipping last separator, we're now here ^^ + if (tokens[end].type === 'separator') + end = find_last_non_ws_token(tokens, begin, end - 1) + if (end === false) return result + + // ' "key" : "value" ,' + // skipping value ^^^^^^^ + while(tokens[end].stack.length > level) end-- + + if (!is_array) { + while(is_whitespace(tokens[end].type)) { + if (end < begin) return result + if (tokens[end].type === 'whitespace') { + result.sep2.unshift(tokens[end]) + } else { + // newline, comment or other unrecognized codestyle + return result + } + end-- + } + + // ' "key" : "value" ,' + // skipping separator ^ + assert.equal(tokens[end].type, 'separator') + assert.equal(tokens[end].raw, ':') + while(is_whitespace(tokens[--end].type)) { + if (end < begin) return result + if (tokens[end].type === 'whitespace') { + result.sep1.unshift(tokens[end]) + } else { + // newline, comment or other unrecognized codestyle + return result + } + } + + assert.equal(tokens[end].type, 'key') + end-- + } + + // ' "key" : "value" ,' + // skipping key ^^^^^ + while(is_whitespace(tokens[end].type)) { + if (end < begin) return result + if (tokens[end].type === 'whitespace') { + result.prefix.unshift(tokens[end]) + } else if (tokens[end].type === 'newline') { + result.newline.unshift(tokens[end]) + return result + } else { + // comment or other unrecognized codestyle + return result + } + end-- + } + + return result +} + +function Document(text, options) { + var self = Object.create(Document.prototype) + + if (options == null) options = {} + //options._structure = true + var tokens = self._tokens = tokenize(text, options) + self._data = tokens.data + tokens.data = null + self._options = options + + var stats = analyze(text, options) + if (options.indent == null) { + options.indent = stats.indent + } + if (options.quote == null) { + options.quote = stats.quote + } + if (options.quote_keys == null) { + options.quote_keys = stats.quote_keys + } + if (options.no_trailing_comma == null) { + options.no_trailing_comma = !stats.has_trailing_comma + } + return self +} + +// return true if it's a proper object +// throw otherwise +function check_if_can_be_placed(key, object, is_unset) { + //if (object == null) return false + function error(add) { + return Error("You can't " + (is_unset ? 'unset' : 'set') + " key '" + key + "'" + add) + } + + if (!isObject(object)) { + throw error(' of an non-object') + } + if (Array.isArray(object)) { + // array, check boundary + if (String(key).match(/^\d+$/)) { + key = Number(String(key)) + if (object.length < key || (is_unset && object.length === key)) { + throw error(', out of bounds') + } else if (is_unset && object.length !== key+1) { + throw error(' in the middle of an array') + } else { + return true + } + } else { + throw error(' of an array') + } + } else { + // object + return true + } +} + +// usage: document.set('path.to.something', 'value') +// or: document.set(['path','to','something'], 'value') +Document.prototype.set = function(path, value) { + path = arg_to_path(path) + + // updating this._data and check for errors + if (path.length === 0) { + if (value === undefined) throw Error("can't remove root document") + this._data = value + var new_key = false + + } else { + var data = this._data + + for (var i=0; i {x:1}` + // removing sep, literal and optional sep + // ':' + var pos2 = find_last_non_ws_token(this._tokens, pos_old[0], position[0] - 1) + assert.equal(this._tokens[pos2].type, 'separator') + assert.equal(this._tokens[pos2].raw, ':') + position[0] = pos2 + + // key + var pos2 = find_last_non_ws_token(this._tokens, pos_old[0], position[0] - 1) + assert.equal(this._tokens[pos2].type, 'key') + assert.equal(this._tokens[pos2].value, path[path.length-1]) + position[0] = pos2 + } + + // removing comma in arrays and objects + var pos2 = find_last_non_ws_token(this._tokens, pos_old[0], position[0] - 1) + assert.equal(this._tokens[pos2].type, 'separator') + if (this._tokens[pos2].raw === ',') { + position[0] = pos2 + } else { + // beginning of the array/object, so we should remove trailing comma instead + pos2 = find_first_non_ws_token(this._tokens, position[1] + 1, pos_old[1]) + assert.equal(this._tokens[pos2].type, 'separator') + if (this._tokens[pos2].raw === ',') { + position[1] = pos2 + } + } + + } else { + var indent = pos2 !== false + ? detect_indent_style(this._tokens, Array.isArray(data), pos_old[0], position[1] - 1, i) + : {} + var newtokens = value_to_tokenlist(value, path, this._options, false, indent) + } + + } else { + // insert new key, that's tricky + var path_1 = path.slice(0, i) + + // find a last separator after which we're inserting it + var pos2 = find_last_non_ws_token(this._tokens, position[0] + 1, position[1] - 1) + assert(pos2 !== false) + + var indent = pos2 !== false + ? detect_indent_style(this._tokens, Array.isArray(data), position[0] + 1, pos2, i) + : {} + + var newtokens = value_to_tokenlist(value, path, this._options, false, indent) + + // adding leading whitespaces according to detected codestyle + var prefix = [] + if (indent.newline && indent.newline.length) + prefix = prefix.concat(indent.newline) + if (indent.prefix && indent.prefix.length) + prefix = prefix.concat(indent.prefix) + + // adding '"key":' (as in "key":"value") to object values + if (!Array.isArray(data)) { + prefix = prefix.concat(value_to_tokenlist(path[path.length-1], path_1, this._options, true)) + if (indent.sep1 && indent.sep1.length) + prefix = prefix.concat(indent.sep1) + prefix.push({raw: ':', type: 'separator', stack: path_1}) + if (indent.sep2 && indent.sep2.length) + prefix = prefix.concat(indent.sep2) + } + + newtokens.unshift.apply(newtokens, prefix) + + // check if prev token is a separator AND they're at the same level + if (this._tokens[pos2].type === 'separator' && this._tokens[pos2].stack.length === path.length-1) { + // previous token is either , or [ or { + if (this._tokens[pos2].raw === ',') { + // restore ending comma + newtokens.push({raw: ',', type: 'separator', stack: path_1}) + } + } else { + // previous token isn't a separator, so need to insert one + newtokens.unshift({raw: ',', type: 'separator', stack: path_1}) + } + + if (indent.suffix && indent.suffix.length) + newtokens.push.apply(newtokens, indent.suffix) + + assert.equal(this._tokens[position[1]].type, 'separator') + position[0] = pos2+1 + position[1] = pos2 + } + + newtokens.unshift(position[1] - position[0] + 1) + newtokens.unshift(position[0]) + this._tokens.splice.apply(this._tokens, newtokens) + + return this +} + +// convenience method +Document.prototype.unset = function(path) { + return this.set(path, undefined) +} + +Document.prototype.get = function(path) { + path = arg_to_path(path) + + var data = this._data + for (var i=0; i old_data.length) { + // adding new elements, so going forward + for (var i=0; i=0; i--) { + path.push(String(i)) + change(path, old_data[i], new_data[i]) + path.pop() + } + } + + } else { + // both values are objects here + for (var i in new_data) { + path.push(String(i)) + change(path, old_data[i], new_data[i]) + path.pop() + } + + for (var i in old_data) { + if (i in new_data) continue + path.push(String(i)) + change(path, old_data[i], new_data[i]) + path.pop() + } + } + } +} + +Document.prototype.toString = function() { + return this._tokens.map(function(x) { + return x.raw + }).join('') +} + +module.exports.Document = Document + +module.exports.update = function updateJSON(source, new_value, options) { + return Document(source, options).update(new_value).toString() +} + diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js new file mode 100644 index 000000000..0c9fbe688 --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js @@ -0,0 +1,765 @@ +/* + * Author: Alex Kocharin + * GIT: https://github.com/rlidwka/jju + * License: WTFPL, grab your copy here: http://www.wtfpl.net/txt/copying/ + */ + +// RTFM: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf + +var Uni = require('./unicode') + +function isHexDigit(x) { + return (x >= '0' && x <= '9') + || (x >= 'A' && x <= 'F') + || (x >= 'a' && x <= 'f') +} + +function isOctDigit(x) { + return x >= '0' && x <= '7' +} + +function isDecDigit(x) { + return x >= '0' && x <= '9' +} + +var unescapeMap = { + '\'': '\'', + '"' : '"', + '\\': '\\', + 'b' : '\b', + 'f' : '\f', + 'n' : '\n', + 'r' : '\r', + 't' : '\t', + 'v' : '\v', + '/' : '/', +} + +function formatError(input, msg, position, lineno, column, json5) { + var result = msg + ' at ' + (lineno + 1) + ':' + (column + 1) + , tmppos = position - column - 1 + , srcline = '' + , underline = '' + + var isLineTerminator = json5 ? Uni.isLineTerminator : Uni.isLineTerminatorJSON + + // output no more than 70 characters before the wrong ones + if (tmppos < position - 70) { + tmppos = position - 70 + } + + while (1) { + var chr = input[++tmppos] + + if (isLineTerminator(chr) || tmppos === input.length) { + if (position >= tmppos) { + // ending line error, so show it after the last char + underline += '^' + } + break + } + srcline += chr + + if (position === tmppos) { + underline += '^' + } else if (position > tmppos) { + underline += input[tmppos] === '\t' ? '\t' : ' ' + } + + // output no more than 78 characters on the string + if (srcline.length > 78) break + } + + return result + '\n' + srcline + '\n' + underline +} + +function parse(input, options) { + // parse as a standard JSON mode + var json5 = false; + var cjson = false; + + if (options.legacy || options.mode === 'json') { + // use json + } else if (options.mode === 'cjson') { + cjson = true; + } else if (options.mode === 'json5') { + json5 = true; + } else { + // use it by default + json5 = true; + } + + var isLineTerminator = json5 ? Uni.isLineTerminator : Uni.isLineTerminatorJSON + var isWhiteSpace = json5 ? Uni.isWhiteSpace : Uni.isWhiteSpaceJSON + + var length = input.length + , lineno = 0 + , linestart = 0 + , position = 0 + , stack = [] + + var tokenStart = function() {} + var tokenEnd = function(v) {return v} + + /* tokenize({ + raw: '...', + type: 'whitespace'|'comment'|'key'|'literal'|'separator'|'newline', + value: 'number'|'string'|'whatever', + path: [...], + }) + */ + if (options._tokenize) { + ;(function() { + var start = null + tokenStart = function() { + if (start !== null) throw Error('internal error, token overlap') + start = position + } + + tokenEnd = function(v, type) { + if (start != position) { + var hash = { + raw: input.substr(start, position-start), + type: type, + stack: stack.slice(0), + } + if (v !== undefined) hash.value = v + options._tokenize.call(null, hash) + } + start = null + return v + } + })() + } + + function fail(msg) { + var column = position - linestart + + if (!msg) { + if (position < length) { + var token = '\'' + + JSON + .stringify(input[position]) + .replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + + '\'' + + if (!msg) msg = 'Unexpected token ' + token + } else { + if (!msg) msg = 'Unexpected end of input' + } + } + + var error = SyntaxError(formatError(input, msg, position, lineno, column, json5)) + error.row = lineno + 1 + error.column = column + 1 + throw error + } + + function newline(chr) { + // account for + if (chr === '\r' && input[position] === '\n') position++ + linestart = position + lineno++ + } + + function parseGeneric() { + var result + + while (position < length) { + tokenStart() + var chr = input[position++] + + if (chr === '"' || (chr === '\'' && json5)) { + return tokenEnd(parseString(chr), 'literal') + + } else if (chr === '{') { + tokenEnd(undefined, 'separator') + return parseObject() + + } else if (chr === '[') { + tokenEnd(undefined, 'separator') + return parseArray() + + } else if (chr === '-' + || chr === '.' + || isDecDigit(chr) + // + number Infinity NaN + || (json5 && (chr === '+' || chr === 'I' || chr === 'N')) + ) { + return tokenEnd(parseNumber(), 'literal') + + } else if (chr === 'n') { + parseKeyword('null') + return tokenEnd(null, 'literal') + + } else if (chr === 't') { + parseKeyword('true') + return tokenEnd(true, 'literal') + + } else if (chr === 'f') { + parseKeyword('false') + return tokenEnd(false, 'literal') + + } else { + position-- + return tokenEnd(undefined) + } + } + } + + function parseKey() { + var result + + while (position < length) { + tokenStart() + var chr = input[position++] + + if (chr === '"' || (chr === '\'' && json5)) { + return tokenEnd(parseString(chr), 'key') + + } else if (chr === '{') { + tokenEnd(undefined, 'separator') + return parseObject() + + } else if (chr === '[') { + tokenEnd(undefined, 'separator') + return parseArray() + + } else if (chr === '.' + || isDecDigit(chr) + ) { + return tokenEnd(parseNumber(true), 'key') + + } else if (json5 + && Uni.isIdentifierStart(chr) || (chr === '\\' && input[position] === 'u')) { + // unicode char or a unicode sequence + var rollback = position - 1 + var result = parseIdentifier() + + if (result === undefined) { + position = rollback + return tokenEnd(undefined) + } else { + return tokenEnd(result, 'key') + } + + } else { + position-- + return tokenEnd(undefined) + } + } + } + + function skipWhiteSpace() { + tokenStart() + while (position < length) { + var chr = input[position++] + + if (isLineTerminator(chr)) { + position-- + tokenEnd(undefined, 'whitespace') + tokenStart() + position++ + newline(chr) + tokenEnd(undefined, 'newline') + tokenStart() + + } else if (isWhiteSpace(chr)) { + // nothing + + } else if (chr === '/' + && (json5 || cjson) + && (input[position] === '/' || input[position] === '*') + ) { + position-- + tokenEnd(undefined, 'whitespace') + tokenStart() + position++ + skipComment(input[position++] === '*') + tokenEnd(undefined, 'comment') + tokenStart() + + } else { + position-- + break + } + } + return tokenEnd(undefined, 'whitespace') + } + + function skipComment(multi) { + while (position < length) { + var chr = input[position++] + + if (isLineTerminator(chr)) { + // LineTerminator is an end of singleline comment + if (!multi) { + // let parent function deal with newline + position-- + return + } + + newline(chr) + + } else if (chr === '*' && multi) { + // end of multiline comment + if (input[position] === '/') { + position++ + return + } + + } else { + // nothing + } + } + + if (multi) { + fail('Unclosed multiline comment') + } + } + + function parseKeyword(keyword) { + // keyword[0] is not checked because it should've checked earlier + var _pos = position + var len = keyword.length + for (var i=1; i= length || keyword[i] != input[position]) { + position = _pos-1 + fail() + } + position++ + } + } + + function parseObject() { + var result = options.null_prototype ? Object.create(null) : {} + , empty_object = {} + , is_non_empty = false + + while (position < length) { + skipWhiteSpace() + var item1 = parseKey() + skipWhiteSpace() + tokenStart() + var chr = input[position++] + tokenEnd(undefined, 'separator') + + if (chr === '}' && item1 === undefined) { + if (!json5 && is_non_empty) { + position-- + fail('Trailing comma in object') + } + return result + + } else if (chr === ':' && item1 !== undefined) { + skipWhiteSpace() + stack.push(item1) + var item2 = parseGeneric() + stack.pop() + + if (item2 === undefined) fail('No value found for key ' + item1) + if (typeof(item1) !== 'string') { + if (!json5 || typeof(item1) !== 'number') { + fail('Wrong key type: ' + item1) + } + } + + if ((item1 in empty_object || empty_object[item1] != null) && options.reserved_keys !== 'replace') { + if (options.reserved_keys === 'throw') { + fail('Reserved key: ' + item1) + } else { + // silently ignore it + } + } else { + if (typeof(options.reviver) === 'function') { + item2 = options.reviver.call(null, item1, item2) + } + + if (item2 !== undefined) { + is_non_empty = true + Object.defineProperty(result, item1, { + value: item2, + enumerable: true, + configurable: true, + writable: true, + }) + } + } + + skipWhiteSpace() + + tokenStart() + var chr = input[position++] + tokenEnd(undefined, 'separator') + + if (chr === ',') { + continue + + } else if (chr === '}') { + return result + + } else { + fail() + } + + } else { + position-- + fail() + } + } + + fail() + } + + function parseArray() { + var result = [] + + while (position < length) { + skipWhiteSpace() + stack.push(result.length) + var item = parseGeneric() + stack.pop() + skipWhiteSpace() + tokenStart() + var chr = input[position++] + tokenEnd(undefined, 'separator') + + if (item !== undefined) { + if (typeof(options.reviver) === 'function') { + item = options.reviver.call(null, String(result.length), item) + } + if (item === undefined) { + result.length++ + item = true // hack for check below, not included into result + } else { + result.push(item) + } + } + + if (chr === ',') { + if (item === undefined) { + fail('Elisions are not supported') + } + + } else if (chr === ']') { + if (!json5 && item === undefined && result.length) { + position-- + fail('Trailing comma in array') + } + return result + + } else { + position-- + fail() + } + } + } + + function parseNumber() { + // rewind because we don't know first char + position-- + + var start = position + , chr = input[position++] + , t + + var to_num = function(is_octal) { + var str = input.substr(start, position - start) + + if (is_octal) { + var result = parseInt(str.replace(/^0o?/, ''), 8) + } else { + var result = Number(str) + } + + if (Number.isNaN(result)) { + position-- + fail('Bad numeric literal - "' + input.substr(start, position - start + 1) + '"') + } else if (!json5 && !str.match(/^-?(0|[1-9][0-9]*)(\.[0-9]+)?(e[+-]?[0-9]+)?$/i)) { + // additional restrictions imposed by json + position-- + fail('Non-json numeric literal - "' + input.substr(start, position - start + 1) + '"') + } else { + return result + } + } + + // ex: -5982475.249875e+29384 + // ^ skipping this + if (chr === '-' || (chr === '+' && json5)) chr = input[position++] + + if (chr === 'N' && json5) { + parseKeyword('NaN') + return NaN + } + + if (chr === 'I' && json5) { + parseKeyword('Infinity') + + // returning +inf or -inf + return to_num() + } + + if (chr >= '1' && chr <= '9') { + // ex: -5982475.249875e+29384 + // ^^^ skipping these + while (position < length && isDecDigit(input[position])) position++ + chr = input[position++] + } + + // special case for leading zero: 0.123456 + if (chr === '0') { + chr = input[position++] + + // new syntax, "0o777" old syntax, "0777" + var is_octal = chr === 'o' || chr === 'O' || isOctDigit(chr) + var is_hex = chr === 'x' || chr === 'X' + + if (json5 && (is_octal || is_hex)) { + while (position < length + && (is_hex ? isHexDigit : isOctDigit)( input[position] ) + ) position++ + + var sign = 1 + if (input[start] === '-') { + sign = -1 + start++ + } else if (input[start] === '+') { + start++ + } + + return sign * to_num(is_octal) + } + } + + if (chr === '.') { + // ex: -5982475.249875e+29384 + // ^^^ skipping these + while (position < length && isDecDigit(input[position])) position++ + chr = input[position++] + } + + if (chr === 'e' || chr === 'E') { + chr = input[position++] + if (chr === '-' || chr === '+') position++ + // ex: -5982475.249875e+29384 + // ^^^ skipping these + while (position < length && isDecDigit(input[position])) position++ + chr = input[position++] + } + + // we have char in the buffer, so count for it + position-- + return to_num() + } + + function parseIdentifier() { + // rewind because we don't know first char + position-- + + var result = '' + + while (position < length) { + var chr = input[position++] + + if (chr === '\\' + && input[position] === 'u' + && isHexDigit(input[position+1]) + && isHexDigit(input[position+2]) + && isHexDigit(input[position+3]) + && isHexDigit(input[position+4]) + ) { + // UnicodeEscapeSequence + chr = String.fromCharCode(parseInt(input.substr(position+1, 4), 16)) + position += 5 + } + + if (result.length) { + // identifier started + if (Uni.isIdentifierPart(chr)) { + result += chr + } else { + position-- + return result + } + + } else { + if (Uni.isIdentifierStart(chr)) { + result += chr + } else { + return undefined + } + } + } + + fail() + } + + function parseString(endChar) { + // 7.8.4 of ES262 spec + var result = '' + + while (position < length) { + var chr = input[position++] + + if (chr === endChar) { + return result + + } else if (chr === '\\') { + if (position >= length) fail() + chr = input[position++] + + if (unescapeMap[chr] && (json5 || (chr != 'v' && chr != "'"))) { + result += unescapeMap[chr] + + } else if (json5 && isLineTerminator(chr)) { + // line continuation + newline(chr) + + } else if (chr === 'u' || (chr === 'x' && json5)) { + // unicode/character escape sequence + var off = chr === 'u' ? 4 : 2 + + // validation for \uXXXX + for (var i=0; i= length) fail() + if (!isHexDigit(input[position])) fail('Bad escape sequence') + position++ + } + + result += String.fromCharCode(parseInt(input.substr(position-off, off), 16)) + } else if (json5 && isOctDigit(chr)) { + if (chr < '4' && isOctDigit(input[position]) && isOctDigit(input[position+1])) { + // three-digit octal + var digits = 3 + } else if (isOctDigit(input[position])) { + // two-digit octal + var digits = 2 + } else { + var digits = 1 + } + position += digits - 1 + result += String.fromCharCode(parseInt(input.substr(position-digits, digits), 8)) + /*if (!isOctDigit(input[position])) { + // \0 is allowed still + result += '\0' + } else { + fail('Octal literals are not supported') + }*/ + + } else if (json5) { + // \X -> x + result += chr + + } else { + position-- + fail() + } + + } else if (isLineTerminator(chr)) { + fail() + + } else { + if (!json5 && chr.charCodeAt(0) < 32) { + position-- + fail('Unexpected control character') + } + + // SourceCharacter but not one of " or \ or LineTerminator + result += chr + } + } + + fail() + } + + skipWhiteSpace() + var return_value = parseGeneric() + if (return_value !== undefined || position < length) { + skipWhiteSpace() + + if (position >= length) { + if (typeof(options.reviver) === 'function') { + return_value = options.reviver.call(null, '', return_value) + } + return return_value + } else { + fail() + } + + } else { + if (position) { + fail('No data, only a whitespace') + } else { + fail('No data, empty input') + } + } +} + +/* + * parse(text, options) + * or + * parse(text, reviver) + * + * where: + * text - string + * options - object + * reviver - function + */ +module.exports.parse = function parseJSON(input, options) { + // support legacy functions + if (typeof(options) === 'function') { + options = { + reviver: options + } + } + + if (input === undefined) { + // parse(stringify(x)) should be equal x + // with JSON functions it is not 'cause of undefined + // so we're fixing it + return undefined + } + + // JSON.parse compat + if (typeof(input) !== 'string') input = String(input) + if (options == null) options = {} + if (options.reserved_keys == null) options.reserved_keys = 'ignore' + + if (options.reserved_keys === 'throw' || options.reserved_keys === 'ignore') { + if (options.null_prototype == null) { + options.null_prototype = true + } + } + + try { + return parse(input, options) + } catch(err) { + // jju is a recursive parser, so JSON.parse("{{{{{{{") could blow up the stack + // + // this catch is used to skip all those internal calls + if (err instanceof SyntaxError && err.row != null && err.column != null) { + var old_err = err + err = SyntaxError(old_err.message) + err.column = old_err.column + err.row = old_err.row + } + throw err + } +} + +module.exports.tokenize = function tokenizeJSON(input, options) { + if (options == null) options = {} + + options._tokenize = function(smth) { + if (options._addstack) smth.stack.unshift.apply(smth.stack, options._addstack) + tokens.push(smth) + } + + var tokens = [] + tokens.data = module.exports.parse(input, options) + return tokens +} + diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js new file mode 100644 index 000000000..232229ecc --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js @@ -0,0 +1,383 @@ +/* + * Author: Alex Kocharin + * GIT: https://github.com/rlidwka/jju + * License: WTFPL, grab your copy here: http://www.wtfpl.net/txt/copying/ + */ + +var Uni = require('./unicode') + +// Fix Function#name on browsers that do not support it (IE) +// http://stackoverflow.com/questions/6903762/function-name-not-supported-in-ie +if (!(function f(){}).name) { + Object.defineProperty((function(){}).constructor.prototype, 'name', { + get: function() { + var name = this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1] + // For better performance only parse once, and then cache the + // result through a new accessor for repeated access. + Object.defineProperty(this, 'name', { value: name }) + return name + } + }) +} + +var special_chars = { + 0: '\\0', // this is not an octal literal + 8: '\\b', + 9: '\\t', + 10: '\\n', + 11: '\\v', + 12: '\\f', + 13: '\\r', + 92: '\\\\', +} + +// for oddballs +var hasOwnProperty = Object.prototype.hasOwnProperty + +// some people escape those, so I'd copy this to be safe +var escapable = /[\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/ + +function _stringify(object, options, recursiveLvl, currentKey) { + var json5 = (options.mode === 'json5' || !options.mode) + /* + * Opinionated decision warning: + * + * Objects are serialized in the following form: + * { type: 'Class', data: DATA } + * + * Class is supposed to be a function, and new Class(DATA) is + * supposed to be equivalent to the original value + */ + /*function custom_type() { + return stringify({ + type: object.constructor.name, + data: object.toString() + }) + }*/ + + // if add, it's an internal indentation, so we add 1 level and a eol + // if !add, it's an ending indentation, so we just indent + function indent(str, add) { + var prefix = options._prefix ? options._prefix : '' + if (!options.indent) return prefix + str + var result = '' + var count = recursiveLvl + (add || 0) + for (var i=0; i 0) { + if (!Uni.isIdentifierPart(key[i])) + return _stringify_str(key) + + } else { + if (!Uni.isIdentifierStart(key[i])) + return _stringify_str(key) + } + + var chr = key.charCodeAt(i) + + if (options.ascii) { + if (chr < 0x80) { + result += key[i] + + } else { + result += '\\u' + ('0000' + chr.toString(16)).slice(-4) + } + + } else { + if (escapable.exec(key[i])) { + result += '\\u' + ('0000' + chr.toString(16)).slice(-4) + + } else { + result += key[i] + } + } + } + + return result + } + + function _stringify_str(key) { + var quote = options.quote + var quoteChr = quote.charCodeAt(0) + + var result = '' + for (var i=0; i= 8 && chr <= 13 && (json5 || chr !== 11)) { + result += special_chars[chr] + } else if (json5) { + result += '\\x0' + chr.toString(16) + } else { + result += '\\u000' + chr.toString(16) + } + + } else if (chr < 0x20) { + if (json5) { + result += '\\x' + chr.toString(16) + } else { + result += '\\u00' + chr.toString(16) + } + + } else if (chr >= 0x20 && chr < 0x80) { + // ascii range + if (chr === 47 && i && key[i-1] === '<') { + // escaping slashes in + result += '\\' + key[i] + + } else if (chr === 92) { + result += '\\\\' + + } else if (chr === quoteChr) { + result += '\\' + quote + + } else { + result += key[i] + } + + } else if (options.ascii || Uni.isLineTerminator(key[i]) || escapable.exec(key[i])) { + if (chr < 0x100) { + if (json5) { + result += '\\x' + chr.toString(16) + } else { + result += '\\u00' + chr.toString(16) + } + + } else if (chr < 0x1000) { + result += '\\u0' + chr.toString(16) + + } else if (chr < 0x10000) { + result += '\\u' + chr.toString(16) + + } else { + throw Error('weird codepoint') + } + } else { + result += key[i] + } + } + return quote + result + quote + } + + function _stringify_object() { + if (object === null) return 'null' + var result = [] + , len = 0 + , braces + + if (Array.isArray(object)) { + braces = '[]' + for (var i=0; i options._splitMax - recursiveLvl * options.indent.length || len > options._splitMin) ) { + // remove trailing comma in multiline if asked to + if (options.no_trailing_comma && result.length) { + result[result.length-1] = result[result.length-1].substring(0, result[result.length-1].length-1) + } + + var innerStuff = result.map(function(x) {return indent(x, 1)}).join('') + return braces[0] + + (options.indent ? '\n' : '') + + innerStuff + + indent(braces[1]) + } else { + // always remove trailing comma in one-lined arrays + if (result.length) { + result[result.length-1] = result[result.length-1].substring(0, result[result.length-1].length-1) + } + + var innerStuff = result.join(options.indent ? ' ' : '') + return braces[0] + + innerStuff + + braces[1] + } + } + + function _stringify_nonobject(object) { + if (typeof(options.replacer) === 'function') { + object = options.replacer.call(null, currentKey, object) + } + + switch(typeof(object)) { + case 'string': + return _stringify_str(object) + + case 'number': + if (object === 0 && 1/object < 0) { + // Opinionated decision warning: + // + // I want cross-platform negative zero in all js engines + // I know they're equal, but why lose that tiny bit of + // information needlessly? + return '-0' + } + if (!json5 && !Number.isFinite(object)) { + // json don't support infinity (= sucks) + return 'null' + } + return object.toString() + + case 'boolean': + return object.toString() + + case 'undefined': + return undefined + + case 'function': +// return custom_type() + + default: + // fallback for something weird + return JSON.stringify(object) + } + } + + if (options._stringify_key) { + return _stringify_key(object) + } + + if (typeof(object) === 'object') { + if (object === null) return 'null' + + var str + if (typeof(str = object.toJSON5) === 'function' && options.mode !== 'json') { + object = str.call(object, currentKey) + + } else if (typeof(str = object.toJSON) === 'function') { + object = str.call(object, currentKey) + } + + if (object === null) return 'null' + if (typeof(object) !== 'object') return _stringify_nonobject(object) + + if (object.constructor === Number || object.constructor === Boolean || object.constructor === String) { + object = object.valueOf() + return _stringify_nonobject(object) + + } else if (object.constructor === Date) { + // only until we can't do better + return _stringify_nonobject(object.toISOString()) + + } else { + if (typeof(options.replacer) === 'function') { + object = options.replacer.call(null, currentKey, object) + if (typeof(object) !== 'object') return _stringify_nonobject(object) + } + + return _stringify_object(object) + } + } else { + return _stringify_nonobject(object) + } +} + +/* + * stringify(value, options) + * or + * stringify(value, replacer, space) + * + * where: + * value - anything + * options - object + * replacer - function or array + * space - boolean or number or string + */ +module.exports.stringify = function stringifyJSON(object, options, _space) { + // support legacy syntax + if (typeof(options) === 'function' || Array.isArray(options)) { + options = { + replacer: options + } + } else if (typeof(options) === 'object' && options !== null) { + // nothing to do + } else { + options = {} + } + if (_space != null) options.indent = _space + + if (options.indent == null) options.indent = '\t' + if (options.quote == null) options.quote = "'" + if (options.ascii == null) options.ascii = false + if (options.mode == null) options.mode = 'json5' + + if (options.mode === 'json' || options.mode === 'cjson') { + // json only supports double quotes (= sucks) + options.quote = '"' + + // json don't support trailing commas (= sucks) + options.no_trailing_comma = true + + // json don't support unquoted property names (= sucks) + options.quote_keys = true + } + + // why would anyone use such objects? + if (typeof(options.indent) === 'object') { + if (options.indent.constructor === Number + || options.indent.constructor === Boolean + || options.indent.constructor === String) + options.indent = options.indent.valueOf() + } + + // gap is capped at 10 characters + if (typeof(options.indent) === 'number') { + if (options.indent >= 0) { + options.indent = Array(Math.min(~~options.indent, 10) + 1).join(' ') + } else { + options.indent = false + } + } else if (typeof(options.indent) === 'string') { + options.indent = options.indent.substr(0, 10) + } + + if (options._splitMin == null) options._splitMin = 50 + if (options._splitMax == null) options._splitMax = 70 + + return _stringify(object, options, 0, '') +} + diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/unicode.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/unicode.js new file mode 100644 index 000000000..1a29143c2 --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/unicode.js @@ -0,0 +1,71 @@ + +// This is autogenerated with esprima tools, see: +// https://github.com/ariya/esprima/blob/master/esprima.js +// +// PS: oh God, I hate Unicode + +// ECMAScript 5.1/Unicode v6.3.0 NonAsciiIdentifierStart: + +var Uni = module.exports + +module.exports.isWhiteSpace = function isWhiteSpace(x) { + // section 7.2, table 2 + return x === '\u0020' + || x === '\u00A0' + || x === '\uFEFF' // <-- this is not a Unicode WS, only a JS one + || (x >= '\u0009' && x <= '\u000D') // 9 A B C D + + // + whitespace characters from unicode, category Zs + || x === '\u1680' + || x === '\u180E' + || (x >= '\u2000' && x <= '\u200A') // 0 1 2 3 4 5 6 7 8 9 A + || x === '\u2028' + || x === '\u2029' + || x === '\u202F' + || x === '\u205F' + || x === '\u3000' +} + +module.exports.isWhiteSpaceJSON = function isWhiteSpaceJSON(x) { + return x === '\u0020' + || x === '\u0009' + || x === '\u000A' + || x === '\u000D' +} + +module.exports.isLineTerminator = function isLineTerminator(x) { + // ok, here is the part when JSON is wrong + // section 7.3, table 3 + return x === '\u000A' + || x === '\u000D' + || x === '\u2028' + || x === '\u2029' +} + +module.exports.isLineTerminatorJSON = function isLineTerminatorJSON(x) { + return x === '\u000A' + || x === '\u000D' +} + +module.exports.isIdentifierStart = function isIdentifierStart(x) { + return x === '$' + || x === '_' + || (x >= 'A' && x <= 'Z') + || (x >= 'a' && x <= 'z') + || (x >= '\u0080' && Uni.NonAsciiIdentifierStart.test(x)) +} + +module.exports.isIdentifierPart = function isIdentifierPart(x) { + return x === '$' + || x === '_' + || (x >= 'A' && x <= 'Z') + || (x >= 'a' && x <= 'z') + || (x >= '0' && x <= '9') // <-- addition to Start + || (x >= '\u0080' && Uni.NonAsciiIdentifierPart.test(x)) +} + +module.exports.NonAsciiIdentifierStart = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ + +// ECMAScript 5.1/Unicode v6.3.0 NonAsciiIdentifierPart: + +module.exports.NonAsciiIdentifierPart = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0\u08A2-\u08AC\u08E4-\u08FE\u0900-\u0963\u0966-\u096F\u0971-\u0977\u0979-\u097F\u0981-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C82\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D02\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191C\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1D00-\u1DE6\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA697\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7B\uAA80-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE26\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js new file mode 100644 index 000000000..a8476b6c4 --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js @@ -0,0 +1,46 @@ +var FS = require('fs') +var jju = require('../') + +// this function registers json5 extension, so you +// can do `require("./config.json5")` kind of thing +module.exports.register = function() { + var r = require, e = 'extensions' + r[e]['.json5'] = function(m, f) { + /*eslint no-sync:0*/ + m.exports = jju.parse(FS.readFileSync(f, 'utf8')) + } +} + +// this function monkey-patches JSON.parse, so it +// will return an exact position of error in case +// of parse failure +module.exports.patch_JSON_parse = function() { + var _parse = JSON.parse + JSON.parse = function(text, rev) { + try { + return _parse(text, rev) + } catch(err) { + // this call should always throw + require('jju').parse(text, { + mode: 'json', + legacy: true, + reviver: rev, + reserved_keys: 'replace', + null_prototype: false, + }) + + // if it didn't throw, but original parser did, + // this is an error in this library and should be reported + throw err + } + } +} + +// this function is an express/connect middleware +// that accepts uploads in application/json5 format +module.exports.middleware = function() { + return function(req, res, next) { + throw Error('this function is removed, use express-json5 instead') + } +} + diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/package.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/package.json new file mode 100644 index 000000000..8b01adc87 --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/package.json @@ -0,0 +1,65 @@ +{ + "_from": "jju@^1.1.0", + "_id": "jju@1.3.0", + "_inBundle": false, + "_integrity": "sha1-2t2e8BkkvHKLA/L3l5vb1i96Kqo=", + "_location": "/pacote/make-fetch-happen/node-fetch-npm/json-parse-helpfulerror/jju", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "jju@^1.1.0", + "name": "jju", + "escapedName": "jju", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/pacote/make-fetch-happen/node-fetch-npm/json-parse-helpfulerror" + ], + "_resolved": "https://registry.npmjs.org/jju/-/jju-1.3.0.tgz", + "_shasum": "dadd9ef01924bc728b03f2f7979bdbd62f7a2aaa", + "_spec": "jju@^1.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror", + "author": { + "name": "Alex Kocharin", + "email": "alex@kocharin.ru" + }, + "bugs": { + "url": "https://github.com/rlidwka/jju/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "a set of utilities to work with JSON / JSON5 documents", + "devDependencies": { + "eslint": "~0.4.2", + "js-yaml": ">=3.1.0", + "mocha": ">=1.21.0" + }, + "homepage": "http://rlidwka.github.io/jju/", + "keywords": [ + "json", + "json5", + "parser", + "serializer", + "data" + ], + "license": { + "type": "WTFPL", + "url": "http://www.wtfpl.net/txt/copying/" + }, + "name": "jju", + "publishConfig": { + "registry": "https://registry.npmjs.org/" + }, + "repository": { + "type": "git", + "url": "git://github.com/rlidwka/jju.git" + }, + "scripts": { + "lint": "eslint -c ./.eslint.yaml ./lib", + "test": "mocha test/*.js" + }, + "version": "1.3.0" +} diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml new file mode 100644 index 000000000..fdbb5372d --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml @@ -0,0 +1,46 @@ +# use "yapm install ." if you're installing this from git repository + +# "jju" stands for "json/json5 utils" +name: jju + +version: 1.3.0 +description: a set of utilities to work with JSON / JSON5 documents + +author: + name: Alex Kocharin + email: alex@kocharin.ru + +repository: + type: git + url: git://github.com/rlidwka/jju + +bugs: + url: https://github.com/rlidwka/jju/issues + +homepage: http://rlidwka.github.io/jju/ + +devDependencies: + mocha: '>=1.21.0' + js-yaml: '>=3.1.0' + + # linting tools + eslint: '~0.4.2' + +scripts: + test: 'mocha test/*.js' + lint: 'eslint -c ./.eslint.yaml ./lib' + +keywords: + - json + - json5 + - parser + - serializer + - data + +publishConfig: + registry: https://registry.npmjs.org/ + +license: + type: WTFPL + url: http://www.wtfpl.net/txt/copying/ + diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/package.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/package.json new file mode 100644 index 000000000..6c723ae8e --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/package.json @@ -0,0 +1,63 @@ +{ + "_from": "json-parse-helpfulerror@^1.0.3", + "_id": "json-parse-helpfulerror@1.0.3", + "_inBundle": false, + "_integrity": "sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w=", + "_location": "/pacote/make-fetch-happen/node-fetch-npm/json-parse-helpfulerror", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "json-parse-helpfulerror@^1.0.3", + "name": "json-parse-helpfulerror", + "escapedName": "json-parse-helpfulerror", + "rawSpec": "^1.0.3", + "saveSpec": null, + "fetchSpec": "^1.0.3" + }, + "_requiredBy": [ + "/pacote/make-fetch-happen/node-fetch-npm" + ], + "_resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", + "_shasum": "13f14ce02eed4e981297b64eb9e3b932e2dd13dc", + "_spec": "json-parse-helpfulerror@^1.0.3", + "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm", + "author": { + "name": "Sam Mikes", + "email": "smikes@cubane.com" + }, + "bugs": { + "url": "https://github.com/smikes/json-parse-helpfulerror/issues" + }, + "bundleDependencies": false, + "dependencies": { + "jju": "^1.1.0" + }, + "deprecated": false, + "description": "A drop-in replacement for JSON.parse that uses `jju` to give helpful errors", + "devDependencies": { + "code": "^1.2.1", + "jslint": "^0.7.1", + "lab": "^5.1.1" + }, + "homepage": "https://github.com/smikes/json-parse-helpfulerror", + "keywords": [ + "json", + "parse", + "line", + "doublequote", + "error" + ], + "license": "MIT", + "main": "index.js", + "name": "json-parse-helpfulerror", + "repository": { + "type": "git", + "url": "git+https://github.com/smikes/json-parse-helpfulerror.git" + }, + "scripts": { + "lint": "jslint --edition=latest --terse *.js", + "test": "lab -c" + }, + "version": "1.0.3" +} diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/test/test.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/test/test.js new file mode 100644 index 000000000..fca458ac0 --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-helpfulerror/test/test.js @@ -0,0 +1,32 @@ +var Code = require('code'), + Lab = require('lab'), + lab = Lab.script(), + jph = require('..'); // 'json-parse-helpfulerror' + +exports.lab = lab; + +lab.test('can parse', function (done) { + var o = jph.parse('{"foo": "bar"}'); + + Code.expect(o.foo).to.equal('bar'); + done(); +}); + +lab.test('helpful error for bad JSON', function (done) { + + var bad = "{'foo': 'bar'}"; + + Code.expect(function () { JSON.parse(bad) }).to.throw(); + + Code.expect(function () { jph.parse(bad) }).to.throw(SyntaxError, "Unexpected token '\\'' at 1:2\n" + bad + '\n ^'); + + done(); +}); + +lab.test('fails if reviver throws', function (done) { + function badReviver() { throw new ReferenceError('silly'); } + + Code.expect(function () { jph.parse('3', badReviver) }).to.throw(ReferenceError, 'silly'); + + done(); +}); \ No newline at end of file diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/package.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/package.json index 09b56c7ea..b98cbe199 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/package.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/package.json @@ -1,7 +1,8 @@ { "_from": "node-fetch-npm@^2.0.0", - "_id": "node-fetch-npm@2.0.0", - "_integrity": "sha512-o8Vxcb16qHPAkqBTPIrxvGSY0dHrtwsk2opomChLWg/2MFJW/hqB3XDG78k0gyI0cmy95kSFjn4BLrMkbQFHAQ==", + "_id": "node-fetch-npm@2.0.1", + "_inBundle": false, + "_integrity": "sha512-W3onhopST5tqpX0/MGSL47pDQLLKobNR83AvkiOWQKaw54h+uYUfzeLAxCiyhWlUOiuI+GIb4O9ojLaAFlhCCA==", "_location": "/pacote/make-fetch-happen/node-fetch-npm", "_phantomChildren": {}, "_requested": { @@ -17,15 +18,13 @@ "_requiredBy": [ "/pacote/make-fetch-happen" ], - "_resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.0.tgz", - "_shasum": "baab3734bdc50c614af5252bd1ee37a3662bf1ad", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.1.tgz", + "_shasum": "4dd3355ce526c01bc5ab29ccdf48352dc8a79465", "_spec": "node-fetch-npm@^2.0.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen", "author": { "name": "David Frank" }, - "bin": null, "bugs": { "url": "https://github.com/npm/node-fetch-npm/issues" }, @@ -42,6 +41,7 @@ ], "dependencies": { "encoding": "^0.1.11", + "json-parse-helpfulerror": "^1.0.3", "safe-buffer": "^5.0.1" }, "deprecated": false, @@ -81,8 +81,6 @@ "license": "MIT", "main": "src/index.js", "name": "node-fetch-npm", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git+https://github.com/npm/node-fetch-npm.git" @@ -98,5 +96,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": "2.0.0" + "version": "2.0.1" } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/body.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/body.js index 87093e79b..2b009b7cf 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/body.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/body.js @@ -11,6 +11,7 @@ const Buffer = require('safe-buffer').Buffer const Blob = require('./blob.js') const BUFFER = Blob.BUFFER const convert = require('encoding').convert +const parseJson = require('json-parse-helpfulerror').parse const FetchError = require('./fetch-error.js') const Stream = require('stream') @@ -92,7 +93,7 @@ Body.prototype = { * @return Promise */ json () { - return consumeBody.call(this).then(buffer => JSON.parse(buffer.toString())) + return consumeBody.call(this).then(buffer => parseJson(buffer.toString())) }, /** diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.travis.yml b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.travis.yml index 85a50123c..41840cb35 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.travis.yml +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.travis.yml @@ -1,8 +1,27 @@ +sudo: false + language: node_js + node_js: - "0.8" - "0.10" - "0.12" -before_install: - - '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28' - - npm install -g npm@latest + - "1" + - "2" + - "3" + - "4" + - "5" + +install: + - PATH="`npm bin`:`npm bin -g`:$PATH" + # Node 0.8 comes with a too obsolete npm + - if [[ "`node --version`" =~ ^v0\.8\. ]]; then npm install -g npm@1.4.28 ; fi + # Install dependencies and build + - npm install + +script: + # Output useful info for debugging + - node --version + - npm --version + # Run tests + - npm test diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/History.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/History.md index 519a31b37..7c464a63d 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/History.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/History.md @@ -1,4 +1,14 @@ +2.1.0 / 2017-05-24 +================== + + * DRY post-lookup logic + * Fix an error in readme (#13, @599316527) + * travis: test node v5 + * travis: test iojs v1, 2, 3 and node.js v4 + * test: use ssl-cert-snakeoil cert files + * Authentication support (#9, @baryshev) + 2.0.0 / 2015-07-10 ================== diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/README.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/README.md index f671685d3..30d33500a 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/README.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/README.md @@ -70,7 +70,7 @@ var opts = url.parse(endpoint); var agent = new SocksProxyAgent(proxy, true); opts.agent = agent; -http.get(opts, function (res) { +https.get(opts, function (res) { console.log('"response" event!', res.headers); res.pipe(process.stdout); }); diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/package.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/package.json index 39234938d..ff492a278 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/package.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/package.json @@ -1,7 +1,8 @@ { "_from": "socks-proxy-agent@^2.0.0", - "_id": "socks-proxy-agent@2.0.0", - "_integrity": "sha1-xnSELXBBD7KK4ekuYTWpJ4VLwnU=", + "_id": "socks-proxy-agent@2.1.0", + "_inBundle": false, + "_integrity": "sha1-3fsBtdvqX8h5SQyjiiX+h9PRWRI=", "_location": "/pacote/make-fetch-happen/socks-proxy-agent", "_phantomChildren": {}, "_requested": { @@ -17,9 +18,8 @@ "_requiredBy": [ "/pacote/make-fetch-happen" ], - "_resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-2.0.0.tgz", - "_shasum": "c674842d70410fb28ae1e92e6135a927854bc275", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-2.1.0.tgz", + "_shasum": "ddfb01b5dbea5fc879490ca38a25fe87d3d15912", "_spec": "socks-proxy-agent@^2.0.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen", "author": { @@ -27,7 +27,6 @@ "email": "nathan@tootallnate.net", "url": "http://n8.io/" }, - "bin": null, "bugs": { "url": "https://github.com/TooTallNate/node-socks-proxy-agent/issues" }, @@ -56,8 +55,6 @@ "license": "MIT", "main": "socks-proxy-agent.js", "name": "socks-proxy-agent", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-socks-proxy-agent.git" @@ -65,5 +62,5 @@ "scripts": { "test": "mocha --reporter spec" }, - "version": "2.0.0" + "version": "2.1.0" } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/socks-proxy-agent.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/socks-proxy-agent.js index 46d30f7c6..c1f769e24 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/socks-proxy-agent.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/socks-proxy-agent.js @@ -67,6 +67,11 @@ function SocksProxyAgent (opts) { throw new TypeError('A "socks" protocol must be specified! Got: ' + proxy.protocol); } + if (proxy.auth) { + var auth = proxy.auth.split(':'); + proxy.authentication = {username: auth[0], password: auth[1]}; + proxy.userid = auth[0]; + } this.proxy = proxy; } inherits(SocksProxyAgent, Agent); @@ -102,7 +107,7 @@ function connect (req, opts, fn) { } // called for the `dns.lookup()` callback - function onlookup (err, ip, type) { + function onlookup (err, ip) { if (err) return fn(err); options.target.host = ip; SocksClient.createConnection(options, onhostconnect); @@ -119,13 +124,16 @@ function connect (req, opts, fn) { }, command: 'connect' }; + if (proxy.authentication) { + options.proxy.authentication = proxy.authentication; + options.proxy.userid = proxy.userid; + } if (proxy.lookup) { // client-side DNS resolution for "4" and "5" socks proxy versions dns.lookup(opts.host, onlookup); } else { // proxy hostname DNS resolution for "4a" and "5h" socks proxy servers - options.target.host = opts.host; - SocksClient.createConnection(options, onhostconnect); + onlookup(null, opts.host) } } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.crt b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.crt deleted file mode 100644 index 9580116cd..000000000 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.crt +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICATCCAWoCCQCSMIVZI8DGgTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB -VTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0 -cyBQdHkgTHRkMB4XDTEzMDkwOTIyNTI1MVoXDTE0MDkwOTIyNTI1MVowRTELMAkG -A1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGEludGVybmV0 -IFdpZGdpdHMgUHR5IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwQO2 -jlSxR12EvpF1hROxQAyQzDsxVv7AjDGhSVhizn7anxo5mCE9+5jHRJ6hgxF/3RJO -q157J49W7hlgiJfN3X4Q3WCqkTnfj1wFr8aSjWUl6TWeLMrhKZgzGCmZH0GV4Kpu -4jQ4lyjl/dIBw8HiJmKvaEagdUb5UJCKBDrDtvECAwEAATANBgkqhkiG9w0BAQUF -AAOBgQB33WAM5Yr2jkaeRog6rEglMC8i+Jab12amnFFJEMoWnH6csXVGSXxCtlX8 -FWnCoNb/D71dnEusS4JxbYluRg2Xrdfb/pmHje9pE2TTprZRBFAIoh4CmDh129Ka -HJwYPZi59XRnac8ghiF2l4d2yOQPznrJDekj6pfLVdIcVowSvg== ------END CERTIFICATE----- diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.key b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.key deleted file mode 100644 index 25ade3cd1..000000000 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDBA7aOVLFHXYS+kXWFE7FADJDMOzFW/sCMMaFJWGLOftqfGjmY -IT37mMdEnqGDEX/dEk6rXnsnj1buGWCIl83dfhDdYKqROd+PXAWvxpKNZSXpNZ4s -yuEpmDMYKZkfQZXgqm7iNDiXKOX90gHDweImYq9oRqB1RvlQkIoEOsO28QIDAQAB -AoGBAJGXlm34bp0Rat9A46/VMd/JWrPjdo1TrrRRf4LO3AE9aPWYl5cshA+zp6QY -MGaonZWJiLP1mdo2YnFJzSpbr9mzEBEIjCsKdzeKbmnaEpCZY5YUj/ypVWYVJqXx -jZ6/9VEIxCrB9WmXi9fs97IZtZJcHI4M+0FXakjF9AmxtVvRAkEA5MNakvgLPn5s -GH5yuu0P0vSQ6d7EEgcM/89pjEpfKCvsYBh92VvmKspjBV71OuQ3Eh7/0GB/5UGC -gaJwID7ibQJBANf+wBky99/+ffzwrUGavIbLO4NOwnbQsz7v49PwJHoGIhlfoLW7 -21JwDwWUteFyYOwzHxRdKedolT5Ul+PxNBUCQCXYU7Ggq2uJSqS6toxKD6Yco6St -H87Dr9jaHWICI7/nlFFJe/hrhaZqmPsYfIVjn+C1lCiK7l2k+swrbVVIUfkCQQCA -8MgWgvGsWw00+SxElK3kveAaI+M88JuAf85+z8XGvnCOuyKCOtHT5adiCoOFQTWQ -63erPW5tgWZOnktKPMx9AkEAru3G68AjJN6e14aHkK9KFD0DV1RjrIe7E5iQq5Tn -QXyiyiu624him6pov6UIGs5429z+gl3JjRM3A2rl//j//w== ------END RSA PRIVATE KEY----- diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.key b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.key new file mode 100644 index 000000000..fd1250122 --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICWwIBAAKBgQCzURxIqzer0ACAbX/lHdsn4Gd9PLKrf7EeDYfIdV0HZKPD8WDr +bBx2/fBu0OW2sjnzv/SVZbJ0DAuPE/p0+eT0qb2qC10iz9iTD7ribd7gxhirVb8y +b3fBjXsxc8V8p4Ny1LcvNSqCjwUbJqdRogfoJeTiqPM58z5sNzuv5iq7iwIDAQAB +AoGAPMQy4olrP0UotlzlJ36bowLP70ffgHCwU+/f4NWs5fF78c3du0oSx1w820Dd +Z7E0JF8bgnlJJTxjumPZz0RUCugrEHBKJmzEz3cxF5E3+7NvteZcjKn9D67RrM5x +1/uSZ9cqKE9cYvY4fSuHx18diyZ4axR/wB1Pea2utjjDM+ECQQDb9ZbmmaWMiRpQ +5Up+loxP7BZNPsEVsm+DVJmEFbaFgGfncWBqSIqnPNjMwTwj0OigTwCAEGPkfRVW +T0pbYWCxAkEA0LK7SCTwzyDmhASUalk0x+3uCAA6ryFdwJf/wd8TRAvVOmkTEldX +uJ7ldLvfrONYO3v56uKTU/SoNdZYzKtO+wJAX2KM4ctXYy5BXztPpr2acz4qHa1N +Bh+vBAC34fOYhyQ76r3b1btHhWZ5jbFuZwm9F2erC94Ps5IaoqcX07DSwQJAPKGw +h2U0EPkd/3zVIZCJJQya+vgWFIs9EZcXVtvYXQyTBkVApTN66MhBIYjzkub5205J +bVQmOV37AKklY1DhwQJAA1wos0cYxro02edzatxd0DIR2r4qqOqLkw6BhYHhq6HJ +ZvIcQkHqdSXzdETFc01I1znDGGIrJHcnvKWgBPoEUg== +-----END RSA PRIVATE KEY----- diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.pem b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.pem new file mode 100644 index 000000000..b115a5e91 --- /dev/null +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.pem @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE----- +MIIB1TCCAT4CCQDV5mPlzm9+izANBgkqhkiG9w0BAQUFADAvMS0wKwYDVQQDEyQ3 +NTI3YmQ3Ny1hYjNlLTQ3NGItYWNlNy1lZWQ2MDUzOTMxZTcwHhcNMTUwNzA2MjI0 +NTA3WhcNMjUwNzAzMjI0NTA3WjAvMS0wKwYDVQQDEyQ3NTI3YmQ3Ny1hYjNlLTQ3 +NGItYWNlNy1lZWQ2MDUzOTMxZTcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB +ALNRHEirN6vQAIBtf+Ud2yfgZ308sqt/sR4Nh8h1XQdko8PxYOtsHHb98G7Q5bay +OfO/9JVlsnQMC48T+nT55PSpvaoLXSLP2JMPuuJt3uDGGKtVvzJvd8GNezFzxXyn +g3LUty81KoKPBRsmp1GiB+gl5OKo8znzPmw3O6/mKruLAgMBAAEwDQYJKoZIhvcN +AQEFBQADgYEACzoHUF8UV2Z6541Q2wKEA0UFUzmUjf/E1XwBO+1P15ZZ64uw34B4 +1RwMPtAo9RY/PmICTWtNxWGxkzwb2JtDWtnxVER/lF8k2XcXPE76fxTHJF/BKk9J +QU8OTD1dd9gHCBviQB9TqntRZ5X7axjtuWjb2umY+owBYzAHZkp1HKI= +-----END CERTIFICATE----- diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/test.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/test.js index 3ab7e55b2..cc3375334 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/test.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/test.js @@ -44,8 +44,8 @@ describe('SocksProxyAgent', function () { before(function (done) { // setup target SSL HTTPS server var options = { - key: fs.readFileSync(__dirname + '/server.key'), - cert: fs.readFileSync(__dirname + '/server.crt') + key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'), + cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem') }; httpsServer = https.createServer(options); httpsServer.listen(function () { diff --git a/node_modules/pacote/node_modules/make-fetch-happen/package.json b/node_modules/pacote/node_modules/make-fetch-happen/package.json index e74dc5d95..8b8e2cd87 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/package.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/package.json @@ -1,7 +1,8 @@ { - "_from": "make-fetch-happen@^2.4.3", - "_id": "make-fetch-happen@2.4.3", - "_integrity": "sha512-Vi+Y+uUnWki65KG6RjjW6J4o10XJivCyhvSh4TB/XC5gNtD9MbxlyOVkAFKTNCj1w1wcDw7HWaVPGj0CPfAyhw==", + "_from": "make-fetch-happen@^2.4.9", + "_id": "make-fetch-happen@2.4.9", + "_inBundle": false, + "_integrity": "sha512-/qh6T1E2gBD31bhutxeFehcHDwbBJJ7F+7w8bNAzPbacqfTwEpeo7W5SVQqciCSfNex51SjnEyw1XuK4zDn+Fw==", "_location": "/pacote/make-fetch-happen", "_phantomChildren": { "safe-buffer": "5.0.1" @@ -9,42 +10,40 @@ "_requested": { "type": "range", "registry": true, - "raw": "make-fetch-happen@^2.4.3", + "raw": "make-fetch-happen@^2.4.9", "name": "make-fetch-happen", "escapedName": "make-fetch-happen", - "rawSpec": "^2.4.3", + "rawSpec": "^2.4.9", "saveSpec": null, - "fetchSpec": "^2.4.3" + "fetchSpec": "^2.4.9" }, "_requiredBy": [ "/pacote" ], - "_resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-2.4.3.tgz", - "_shasum": "a9e894f213cc4628fde0859a589a90da96f4e4d8", - "_shrinkwrap": null, - "_spec": "make-fetch-happen@^2.4.3", + "_resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-2.4.9.tgz", + "_shasum": "245b799e35da3ec05a45e6ef31f9c34df7d1e0c1", + "_spec": "make-fetch-happen@^2.4.9", "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" }, - "bin": null, "bugs": { "url": "https://github.com/zkat/make-fetch-happen/issues" }, "bundleDependencies": false, "dependencies": { "agentkeepalive": "^3.1.0", - "cacache": "^9.0.0", + "cacache": "^9.2.4", "http-cache-semantics": "^3.7.3", "http-proxy-agent": "^1.0.0", "https-proxy-agent": "^1.0.0", "lru-cache": "^4.0.2", "mississippi": "^1.2.0", - "node-fetch-npm": "^2.0.0", + "node-fetch-npm": "^2.0.1", "promise-retry": "^1.1.1", "socks-proxy-agent": "^2.0.0", - "ssri": "^4.1.2" + "ssri": "^4.1.3" }, "deprecated": false, "description": "Opinionated, caching, retrying fetch client", @@ -80,8 +79,6 @@ "license": "CC0-1.0", "main": "index.js", "name": "make-fetch-happen", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git+https://github.com/zkat/make-fetch-happen.git" @@ -95,5 +92,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": "2.4.3" + "version": "2.4.9" } diff --git a/node_modules/pacote/node_modules/safe-buffer/.travis.yml b/node_modules/pacote/node_modules/safe-buffer/.travis.yml deleted file mode 100644 index 7b20f28cb..000000000 --- a/node_modules/pacote/node_modules/safe-buffer/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - 'node' - - '5' - - '4' - - '0.12' - - '0.10' diff --git a/node_modules/pacote/node_modules/safe-buffer/LICENSE b/node_modules/pacote/node_modules/safe-buffer/LICENSE deleted file mode 100644 index 0c068ceec..000000000 --- a/node_modules/pacote/node_modules/safe-buffer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh - -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/pacote/node_modules/safe-buffer/README.md b/node_modules/pacote/node_modules/safe-buffer/README.md deleted file mode 100644 index 96eb387aa..000000000 --- a/node_modules/pacote/node_modules/safe-buffer/README.md +++ /dev/null @@ -1,581 +0,0 @@ -# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][npm-url] - -#### Safer Node.js Buffer API - -**Use the new Node.js v6 Buffer APIs (`Buffer.from`, `Buffer.alloc`, -`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in Node.js v0.10, v0.12, v4.x, and v5.x.** - -**Uses the built-in implementations when available.** - -[travis-image]: https://img.shields.io/travis/feross/safe-buffer.svg -[travis-url]: https://travis-ci.org/feross/safe-buffer -[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg -[npm-url]: https://npmjs.org/package/safe-buffer -[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg - -## install - -``` -npm install safe-buffer -``` - -## usage - -The goal of this package is to provide a safe replacement for the node.js `Buffer`. - -It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to -the top of your node.js modules: - -```js -var Buffer = require('safe-buffer').Buffer - -// Existing buffer code will continue to work without issues: - -new Buffer('hey', 'utf8') -new Buffer([1, 2, 3], 'utf8') -new Buffer(obj) -new Buffer(16) // create an uninitialized buffer (potentially unsafe) - -// But you can use these new explicit APIs to make clear what you want: - -Buffer.from('hey', 'utf8') // convert from many types to a Buffer -Buffer.alloc(16) // create a zero-filled buffer (safe) -Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) -``` - -## api - -### Class Method: Buffer.from(array) - - -* `array` {Array} - -Allocates a new `Buffer` using an `array` of octets. - -```js -const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); - // creates a new Buffer containing ASCII bytes - // ['b','u','f','f','e','r'] -``` - -A `TypeError` will be thrown if `array` is not an `Array`. - -### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) - - -* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or - a `new ArrayBuffer()` -* `byteOffset` {Number} Default: `0` -* `length` {Number} Default: `arrayBuffer.length - byteOffset` - -When passed a reference to the `.buffer` property of a `TypedArray` instance, -the newly created `Buffer` will share the same allocated memory as the -TypedArray. - -```js -const arr = new Uint16Array(2); -arr[0] = 5000; -arr[1] = 4000; - -const buf = Buffer.from(arr.buffer); // shares the memory with arr; - -console.log(buf); - // Prints: - -// changing the TypedArray changes the Buffer also -arr[1] = 6000; - -console.log(buf); - // Prints: -``` - -The optional `byteOffset` and `length` arguments specify a memory range within -the `arrayBuffer` that will be shared by the `Buffer`. - -```js -const ab = new ArrayBuffer(10); -const buf = Buffer.from(ab, 0, 2); -console.log(buf.length); - // Prints: 2 -``` - -A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. - -### Class Method: Buffer.from(buffer) - - -* `buffer` {Buffer} - -Copies the passed `buffer` data onto a new `Buffer` instance. - -```js -const buf1 = Buffer.from('buffer'); -const buf2 = Buffer.from(buf1); - -buf1[0] = 0x61; -console.log(buf1.toString()); - // 'auffer' -console.log(buf2.toString()); - // 'buffer' (copy is not changed) -``` - -A `TypeError` will be thrown if `buffer` is not a `Buffer`. - -### Class Method: Buffer.from(str[, encoding]) - - -* `str` {String} String to encode. -* `encoding` {String} Encoding to use, Default: `'utf8'` - -Creates a new `Buffer` containing the given JavaScript string `str`. If -provided, the `encoding` parameter identifies the character encoding. -If not provided, `encoding` defaults to `'utf8'`. - -```js -const buf1 = Buffer.from('this is a tést'); -console.log(buf1.toString()); - // prints: this is a tést -console.log(buf1.toString('ascii')); - // prints: this is a tC)st - -const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); -console.log(buf2.toString()); - // prints: this is a tést -``` - -A `TypeError` will be thrown if `str` is not a string. - -### Class Method: Buffer.alloc(size[, fill[, encoding]]) - - -* `size` {Number} -* `fill` {Value} Default: `undefined` -* `encoding` {String} Default: `utf8` - -Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the -`Buffer` will be *zero-filled*. - -```js -const buf = Buffer.alloc(5); -console.log(buf); - // -``` - -The `size` must be less than or equal to the value of -`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is -`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will -be created if a `size` less than or equal to 0 is specified. - -If `fill` is specified, the allocated `Buffer` will be initialized by calling -`buf.fill(fill)`. See [`buf.fill()`][] for more information. - -```js -const buf = Buffer.alloc(5, 'a'); -console.log(buf); - // -``` - -If both `fill` and `encoding` are specified, the allocated `Buffer` will be -initialized by calling `buf.fill(fill, encoding)`. For example: - -```js -const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); -console.log(buf); - // -``` - -Calling `Buffer.alloc(size)` can be significantly slower than the alternative -`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance -contents will *never contain sensitive data*. - -A `TypeError` will be thrown if `size` is not a number. - -### Class Method: Buffer.allocUnsafe(size) - - -* `size` {Number} - -Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must -be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit -architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is -thrown. A zero-length Buffer will be created if a `size` less than or equal to -0 is specified. - -The underlying memory for `Buffer` instances created in this way is *not -initialized*. The contents of the newly created `Buffer` are unknown and -*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such -`Buffer` instances to zeroes. - -```js -const buf = Buffer.allocUnsafe(5); -console.log(buf); - // - // (octets will be different, every time) -buf.fill(0); -console.log(buf); - // -``` - -A `TypeError` will be thrown if `size` is not a number. - -Note that the `Buffer` module pre-allocates an internal `Buffer` instance of -size `Buffer.poolSize` that is used as a pool for the fast allocation of new -`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated -`new Buffer(size)` constructor) only when `size` is less than or equal to -`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default -value of `Buffer.poolSize` is `8192` but can be modified. - -Use of this pre-allocated internal memory pool is a key difference between -calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. -Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer -pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal -Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The -difference is subtle but can be important when an application requires the -additional performance that `Buffer.allocUnsafe(size)` provides. - -### Class Method: Buffer.allocUnsafeSlow(size) - - -* `size` {Number} - -Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The -`size` must be less than or equal to the value of -`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is -`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will -be created if a `size` less than or equal to 0 is specified. - -The underlying memory for `Buffer` instances created in this way is *not -initialized*. The contents of the newly created `Buffer` are unknown and -*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such -`Buffer` instances to zeroes. - -When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, -allocations under 4KB are, by default, sliced from a single pre-allocated -`Buffer`. This allows applications to avoid the garbage collection overhead of -creating many individually allocated Buffers. This approach improves both -performance and memory usage by eliminating the need to track and cleanup as -many `Persistent` objects. - -However, in the case where a developer may need to retain a small chunk of -memory from a pool for an indeterminate amount of time, it may be appropriate -to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then -copy out the relevant bits. - -```js -// need to keep around a few small chunks of memory -const store = []; - -socket.on('readable', () => { - const data = socket.read(); - // allocate for retained data - const sb = Buffer.allocUnsafeSlow(10); - // copy the data into the new allocation - data.copy(sb, 0, 0, 10); - store.push(sb); -}); -``` - -Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* -a developer has observed undue memory retention in their applications. - -A `TypeError` will be thrown if `size` is not a number. - -### All the Rest - -The rest of the `Buffer` API is exactly the same as in node.js. -[See the docs](https://nodejs.org/api/buffer.html). - - -## Related links - -- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) -- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) - -## Why is `Buffer` unsafe? - -Today, the node.js `Buffer` constructor is overloaded to handle many different argument -types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), -`ArrayBuffer`, and also `Number`. - -The API is optimized for convenience: you can throw any type at it, and it will try to do -what you want. - -Because the Buffer constructor is so powerful, you often see code like this: - -```js -// Convert UTF-8 strings to hex -function toHex (str) { - return new Buffer(str).toString('hex') -} -``` - -***But what happens if `toHex` is called with a `Number` argument?*** - -### Remote Memory Disclosure - -If an attacker can make your program call the `Buffer` constructor with a `Number` -argument, then they can make it allocate uninitialized memory from the node.js process. -This could potentially disclose TLS private keys, user data, or database passwords. - -When the `Buffer` constructor is passed a `Number` argument, it returns an -**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like -this, you **MUST** overwrite the contents before returning it to the user. - -From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): - -> `new Buffer(size)` -> -> - `size` Number -> -> The underlying memory for `Buffer` instances created in this way is not initialized. -> **The contents of a newly created `Buffer` are unknown and could contain sensitive -> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. - -(Emphasis our own.) - -Whenever the programmer intended to create an uninitialized `Buffer` you often see code -like this: - -```js -var buf = new Buffer(16) - -// Immediately overwrite the uninitialized buffer with data from another buffer -for (var i = 0; i < buf.length; i++) { - buf[i] = otherBuf[i] -} -``` - - -### Would this ever be a problem in real code? - -Yes. It's surprisingly common to forget to check the type of your variables in a -dynamically-typed language like JavaScript. - -Usually the consequences of assuming the wrong type is that your program crashes with an -uncaught exception. But the failure mode for forgetting to check the type of arguments to -the `Buffer` constructor is more catastrophic. - -Here's an example of a vulnerable service that takes a JSON payload and converts it to -hex: - -```js -// Take a JSON payload {str: "some string"} and convert it to hex -var server = http.createServer(function (req, res) { - var data = '' - req.setEncoding('utf8') - req.on('data', function (chunk) { - data += chunk - }) - req.on('end', function () { - var body = JSON.parse(data) - res.end(new Buffer(body.str).toString('hex')) - }) -}) - -server.listen(8080) -``` - -In this example, an http client just has to send: - -```json -{ - "str": 1000 -} -``` - -and it will get back 1,000 bytes of uninitialized memory from the server. - -This is a very serious bug. It's similar in severity to the -[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process -memory by remote attackers. - - -### Which real-world packages were vulnerable? - -#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) - -[Mathias Buus](https://github.com/mafintosh) and I -([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, -[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow -anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get -them to reveal 20 bytes at a time of uninitialized memory from the node.js process. - -Here's -[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) -that fixed it. We released a new fixed version, created a -[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all -vulnerable versions on npm so users will get a warning to upgrade to a newer version. - -#### [`ws`](https://www.npmjs.com/package/ws) - -That got us wondering if there were other vulnerable packages. Sure enough, within a short -period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the -most popular WebSocket implementation in node.js. - -If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as -expected, then uninitialized server memory would be disclosed to the remote peer. - -These were the vulnerable methods: - -```js -socket.send(number) -socket.ping(number) -socket.pong(number) -``` - -Here's a vulnerable socket server with some echo functionality: - -```js -server.on('connection', function (socket) { - socket.on('message', function (message) { - message = JSON.parse(message) - if (message.type === 'echo') { - socket.send(message.data) // send back the user's message - } - }) -}) -``` - -`socket.send(number)` called on the server, will disclose server memory. - -Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue -was fixed, with a more detailed explanation. Props to -[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the -[Node Security Project disclosure](https://nodesecurity.io/advisories/67). - - -### What's the solution? - -It's important that node.js offers a fast way to get memory otherwise performance-critical -applications would needlessly get a lot slower. - -But we need a better way to *signal our intent* as programmers. **When we want -uninitialized memory, we should request it explicitly.** - -Sensitive functionality should not be packed into a developer-friendly API that loosely -accepts many different types. This type of API encourages the lazy practice of passing -variables in without checking the type very carefully. - -#### A new API: `Buffer.allocUnsafe(number)` - -The functionality of creating buffers with uninitialized memory should be part of another -API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that -frequently gets user input of all sorts of different types passed into it. - -```js -var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! - -// Immediately overwrite the uninitialized buffer with data from another buffer -for (var i = 0; i < buf.length; i++) { - buf[i] = otherBuf[i] -} -``` - - -### How do we fix node.js core? - -We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as -`semver-major`) which defends against one case: - -```js -var str = 16 -new Buffer(str, 'utf8') -``` - -In this situation, it's implied that the programmer intended the first argument to be a -string, since they passed an encoding as a second argument. Today, node.js will allocate -uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not -what the programmer intended. - -But this is only a partial solution, since if the programmer does `new Buffer(variable)` -(without an `encoding` parameter) there's no way to know what they intended. If `variable` -is sometimes a number, then uninitialized memory will sometimes be returned. - -### What's the real long-term fix? - -We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when -we need uninitialized memory. But that would break 1000s of packages. - -~~We believe the best solution is to:~~ - -~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ - -~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ - -#### Update - -We now support adding three new APIs: - -- `Buffer.from(value)` - convert from any type to a buffer -- `Buffer.alloc(size)` - create a zero-filled buffer -- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size - -This solves the core problem that affected `ws` and `bittorrent-dht` which is -`Buffer(variable)` getting tricked into taking a number argument. - -This way, existing code continues working and the impact on the npm ecosystem will be -minimal. Over time, npm maintainers can migrate performance-critical code to use -`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. - - -### Conclusion - -We think there's a serious design issue with the `Buffer` API as it exists today. It -promotes insecure software by putting high-risk functionality into a convenient API -with friendly "developer ergonomics". - -This wasn't merely a theoretical exercise because we found the issue in some of the -most popular npm packages. - -Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of -`buffer`. - -```js -var Buffer = require('safe-buffer').Buffer -``` - -Eventually, we hope that node.js core can switch to this new, safer behavior. We believe -the impact on the ecosystem would be minimal since it's not a breaking change. -Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while -older, insecure packages would magically become safe from this attack vector. - - -## links - -- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) -- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) -- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) - - -## credit - -The original issues in `bittorrent-dht` -([disclosure](https://nodesecurity.io/advisories/68)) and -`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by -[Mathias Buus](https://github.com/mafintosh) and -[Feross Aboukhadijeh](http://feross.org/). - -Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues -and for his work running the [Node Security Project](https://nodesecurity.io/). - -Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and -auditing the code. - - -## license - -MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/node_modules/pacote/node_modules/safe-buffer/browser.js b/node_modules/pacote/node_modules/safe-buffer/browser.js deleted file mode 100644 index 0bd12027d..000000000 --- a/node_modules/pacote/node_modules/safe-buffer/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('buffer') diff --git a/node_modules/pacote/node_modules/safe-buffer/index.js b/node_modules/pacote/node_modules/safe-buffer/index.js deleted file mode 100644 index 74a7358ee..000000000 --- a/node_modules/pacote/node_modules/safe-buffer/index.js +++ /dev/null @@ -1,58 +0,0 @@ -var buffer = require('buffer') - -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer -} else { - // Copy properties from require('buffer') - Object.keys(buffer).forEach(function (prop) { - exports[prop] = buffer[prop] - }) - exports.Buffer = SafeBuffer -} - -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} - -// Copy static methods from Buffer -Object.keys(Buffer).forEach(function (prop) { - SafeBuffer[prop] = Buffer[prop] -}) - -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - var buf = Buffer(size) - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - } else { - buf.fill(0) - } - return buf -} - -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -} - -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) -} diff --git a/node_modules/pacote/node_modules/safe-buffer/package.json b/node_modules/pacote/node_modules/safe-buffer/package.json deleted file mode 100644 index 267f02494..000000000 --- a/node_modules/pacote/node_modules/safe-buffer/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "safe-buffer@^5.0.1", - "_id": "safe-buffer@5.0.1", - "_integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=", - "_location": "/pacote/safe-buffer", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "safe-buffer@^5.0.1", - "name": "safe-buffer", - "escapedName": "safe-buffer", - "rawSpec": "^5.0.1", - "saveSpec": null, - "fetchSpec": "^5.0.1" - }, - "_requiredBy": [ - "/pacote", - "/pacote/make-fetch-happen/node-fetch-npm" - ], - "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", - "_shasum": "d263ca54696cd8a306b5ca6551e92de57918fbe7", - "_shrinkwrap": null, - "_spec": "safe-buffer@^5.0.1", - "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote", - "author": { - "name": "Feross Aboukhadijeh", - "email": "feross@feross.org", - "url": "http://feross.org" - }, - "bin": null, - "browser": "./browser.js", - "bugs": { - "url": "https://github.com/feross/safe-buffer/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Safer Node.js Buffer API", - "devDependencies": { - "standard": "^7.0.0", - "tape": "^4.0.0", - "zuul": "^3.0.0" - }, - "homepage": "https://github.com/feross/safe-buffer", - "keywords": [ - "buffer", - "buffer allocate", - "node security", - "safe", - "safe-buffer", - "security", - "uninitialized" - ], - "license": "MIT", - "main": "index.js", - "name": "safe-buffer", - "optionalDependencies": {}, - "peerDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/feross/safe-buffer.git" - }, - "scripts": { - "test": "standard && tape test.js" - }, - "version": "5.0.1" -} diff --git a/node_modules/pacote/node_modules/safe-buffer/test.js b/node_modules/pacote/node_modules/safe-buffer/test.js deleted file mode 100644 index 7da8ad761..000000000 --- a/node_modules/pacote/node_modules/safe-buffer/test.js +++ /dev/null @@ -1,99 +0,0 @@ -var test = require('tape') -var SafeBuffer = require('./').Buffer - -test('new SafeBuffer(value) works just like Buffer', function (t) { - t.deepEqual(new SafeBuffer('hey'), new Buffer('hey')) - t.deepEqual(new SafeBuffer('hey', 'utf8'), new Buffer('hey', 'utf8')) - t.deepEqual(new SafeBuffer('686579', 'hex'), new Buffer('686579', 'hex')) - t.deepEqual(new SafeBuffer([1, 2, 3]), new Buffer([1, 2, 3])) - t.deepEqual(new SafeBuffer(new Uint8Array([1, 2, 3])), new Buffer(new Uint8Array([1, 2, 3]))) - - t.equal(typeof SafeBuffer.isBuffer, 'function') - t.equal(SafeBuffer.isBuffer(new SafeBuffer('hey')), true) - t.equal(Buffer.isBuffer(new SafeBuffer('hey')), true) - t.notOk(SafeBuffer.isBuffer({})) - - t.end() -}) - -test('SafeBuffer.from(value) converts to a Buffer', function (t) { - t.deepEqual(SafeBuffer.from('hey'), new Buffer('hey')) - t.deepEqual(SafeBuffer.from('hey', 'utf8'), new Buffer('hey', 'utf8')) - t.deepEqual(SafeBuffer.from('686579', 'hex'), new Buffer('686579', 'hex')) - t.deepEqual(SafeBuffer.from([1, 2, 3]), new Buffer([1, 2, 3])) - t.deepEqual(SafeBuffer.from(new Uint8Array([1, 2, 3])), new Buffer(new Uint8Array([1, 2, 3]))) - - t.end() -}) - -test('SafeBuffer.alloc(number) returns zeroed-out memory', function (t) { - for (var i = 0; i < 10; i++) { - var expected1 = new Buffer(1000) - expected1.fill(0) - t.deepEqual(SafeBuffer.alloc(1000), expected1) - - var expected2 = new Buffer(1000 * 1000) - expected2.fill(0) - t.deepEqual(SafeBuffer.alloc(1000 * 1000), expected2) - } - t.end() -}) - -test('SafeBuffer.allocUnsafe(number)', function (t) { - var buf = SafeBuffer.allocUnsafe(100) // unitialized memory - t.equal(buf.length, 100) - t.equal(SafeBuffer.isBuffer(buf), true) - t.equal(Buffer.isBuffer(buf), true) - t.end() -}) - -test('SafeBuffer.from() throws with number types', function (t) { - t.plan(5) - t.throws(function () { - SafeBuffer.from(0) - }) - t.throws(function () { - SafeBuffer.from(-1) - }) - t.throws(function () { - SafeBuffer.from(NaN) - }) - t.throws(function () { - SafeBuffer.from(Infinity) - }) - t.throws(function () { - SafeBuffer.from(99) - }) -}) - -test('SafeBuffer.allocUnsafe() throws with non-number types', function (t) { - t.plan(4) - t.throws(function () { - SafeBuffer.allocUnsafe('hey') - }) - t.throws(function () { - SafeBuffer.allocUnsafe('hey', 'utf8') - }) - t.throws(function () { - SafeBuffer.allocUnsafe([1, 2, 3]) - }) - t.throws(function () { - SafeBuffer.allocUnsafe({}) - }) -}) - -test('SafeBuffer.alloc() throws with non-number types', function (t) { - t.plan(4) - t.throws(function () { - SafeBuffer.alloc('hey') - }) - t.throws(function () { - SafeBuffer.alloc('hey', 'utf8') - }) - t.throws(function () { - SafeBuffer.alloc([1, 2, 3]) - }) - t.throws(function () { - SafeBuffer.alloc({}) - }) -}) diff --git a/node_modules/pacote/node_modules/tar-fs/node_modules/pump/.npmignore~HEAD b/node_modules/pacote/node_modules/tar-fs/node_modules/pump/.npmignore~HEAD deleted file mode 100644 index 3c3629e64..000000000 --- a/node_modules/pacote/node_modules/tar-fs/node_modules/pump/.npmignore~HEAD +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/pacote/node_modules/tar-fs/node_modules/pump/.npmignore~pacote@2.7.4 b/node_modules/pacote/node_modules/tar-fs/node_modules/pump/.npmignore~pacote@2.7.4 deleted file mode 100644 index 3c3629e64..000000000 --- a/node_modules/pacote/node_modules/tar-fs/node_modules/pump/.npmignore~pacote@2.7.4 +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/pacote/package.json b/node_modules/pacote/package.json index 578b7c868..c27683d0d 100644 --- a/node_modules/pacote/package.json +++ b/node_modules/pacote/package.json @@ -1,11 +1,11 @@ { - "_from": "pacote@latest", - "_id": "pacote@2.7.12", + "_from": "pacote@2.7.21", + "_id": "pacote@2.7.21", "_inBundle": false, - "_integrity": "sha512-HkAuFF2tUtXFqgmweU5eVNia1cUl4/1gYYmm1+eLOIuGPUlCLqvO0wtsKgUgoHbStFToTNh13JgDSgOaMz7REg==", + "_integrity": "sha512-ksTHJiAkJxLmcOGxO6iGMk1cVMTTtIC051ZUqvWbckICIhzScOSBgGRBc4CHRhd62NuqAL082RuOOmb1Mi6o6Q==", "_location": "/pacote", "_phantomChildren": { - "cacache": "9.0.0", + "cacache": "9.2.5", "chownr": "1.0.1", "lru-cache": "4.0.2", "mississippi": "1.3.0", @@ -14,26 +14,27 @@ "once": "1.4.0", "readable-stream": "2.2.9", "retry": "0.10.1", + "safe-buffer": "5.0.1", "semver": "5.3.0", - "ssri": "4.1.2" + "ssri": "4.1.3" }, "_requested": { - "type": "tag", + "type": "version", "registry": true, - "raw": "pacote@latest", + "raw": "pacote@2.7.21", "name": "pacote", "escapedName": "pacote", - "rawSpec": "latest", + "rawSpec": "2.7.21", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "2.7.21" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/pacote/-/pacote-2.7.12.tgz", - "_shasum": "36bced5b5fe29defff827b8da893245d9fb0789f", - "_spec": "pacote@latest", + "_resolved": "https://registry.npmjs.org/pacote/-/pacote-2.7.21.tgz", + "_shasum": "e909e8a0559940053300e1127297e92a1302d244", + "_spec": "pacote@2.7.21", "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Kat Marchán", @@ -55,11 +56,11 @@ ], "dependencies": { "bluebird": "^3.5.0", - "cacache": "^9.0.0", - "glob": "^7.1.1", + "cacache": "^9.2.5", + "glob": "^7.1.2", "lru-cache": "^4.0.2", - "make-fetch-happen": "^2.4.3", - "minimatch": "^3.0.3", + "make-fetch-happen": "^2.4.9", + "minimatch": "^3.0.4", "mississippi": "^1.2.0", "normalize-package-data": "^2.3.6", "npm-package-arg": "^5.0.0", @@ -70,9 +71,9 @@ "protoduck": "^4.0.0", "safe-buffer": "^5.0.1", "semver": "^5.3.0", - "ssri": "^4.1.2", + "ssri": "^4.1.3", "tar-fs": "^1.15.1", - "tar-stream": "^1.5.2", + "tar-stream": "^1.5.4", "unique-filename": "^1.1.0", "which": "^1.2.12" }, @@ -81,15 +82,15 @@ "devDependencies": { "mkdirp": "^0.5.1", "nock": "^9.0.13", - "npmlog": "^4.0.1", - "nyc": "^10.0.0", + "npmlog": "^4.1.0", + "nyc": "^10.3.2", "require-inject": "^1.4.0", "rimraf": "^2.5.4", "standard": "^10.0.1", "standard-version": "^4.0.0", "tacks": "^1.2.6", "tap": "^10.2.0", - "weallbehave": "^1.0.0", + "weallbehave": "^1.2.0", "weallcontribute": "^1.0.7" }, "files": [ @@ -119,5 +120,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": "2.7.12" + "version": "2.7.21" } -- cgit v1.2.3