diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2017-05-12 08:29:44 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2017-05-26 04:55:19 +0300 |
commit | daa77708adeb4fed5067472732deeee05b7930cd (patch) | |
tree | 1f40eaaa3c81283945b9d08decfb84b465818ce5 /node_modules | |
parent | 8cfd94ac132f2c2b3f1e0f085291b89b4cfcf526 (diff) |
pacote@2.7.11
Diffstat (limited to 'node_modules')
-rw-r--r-- | node_modules/pacote/CHANGELOG.md | 10 | ||||
-rw-r--r-- | node_modules/pacote/lib/fetch.js | 55 | ||||
-rw-r--r-- | node_modules/pacote/package.json | 20 |
3 files changed, 52 insertions, 33 deletions
diff --git a/node_modules/pacote/CHANGELOG.md b/node_modules/pacote/CHANGELOG.md index b7814874a..1ac57e0dd 100644 --- a/node_modules/pacote/CHANGELOG.md +++ b/node_modules/pacote/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. +<a name="2.7.11"></a> +## [2.7.11](https://github.com/zkat/pacote/compare/v2.7.10...v2.7.11) (2017-05-12) + + +### Bug Fixes + +* **fetch:** make it play nicer with bundlers ([67cd713](https://github.com/zkat/pacote/commit/67cd713)) + + + <a name="2.7.10"></a> ## [2.7.10](https://github.com/zkat/pacote/compare/v2.7.9...v2.7.10) (2017-05-12) diff --git a/node_modules/pacote/lib/fetch.js b/node_modules/pacote/lib/fetch.js index 8e4a204b5..5c45fa21d 100644 --- a/node_modules/pacote/lib/fetch.js +++ b/node_modules/pacote/lib/fetch.js @@ -26,17 +26,6 @@ function fromManifest (manifest, spec, opts) { return getFetcher(spec.type).fromManifest(manifest, spec, opts) } -const TYPES = new Set([ - 'directory', - 'file', - 'git', - 'hosted', - 'range', - 'remote', - 'tag', - 'version' -]) - const fetchers = {} module.exports.clearMemoized = clearMemoized @@ -47,17 +36,37 @@ function clearMemoized () { } function getFetcher (type) { - if (!TYPES.has(type)) { - throw new Error(`Invalid dependency type requested: ${type}`) - } else if (fetchers[type]) { - return fetchers[type] - } else { - const fetcher = ( - fetchers[type] || - ( - fetchers[type] = require(`./fetchers/${type}`) - ) - ) - return fetcher + if (!fetchers[type]) { + // This is spelled out both to prevent sketchy stuff and to make life + // easier for bundlers/preprocessors. + switch (type) { + case 'directory': + fetchers[type] = require('./fetchers/directory') + break + case 'file': + fetchers[type] = require('./fetchers/file') + break + case 'git': + fetchers[type] = require('./fetchers/git') + break + case 'hosted': + fetchers[type] = require('./fetchers/hosted') + break + case 'range': + fetchers[type] = require('./fetchers/range') + break + case 'remote': + fetchers[type] = require('./fetchers/remote') + break + case 'tag': + fetchers[type] = require('./fetchers/tag') + break + case 'version': + fetchers[type] = require('./fetchers/version') + break + default: + throw new Error(`Invalid dependency type requested: ${type}`) + } } + return fetchers[type] } diff --git a/node_modules/pacote/package.json b/node_modules/pacote/package.json index 63c61b305..bf665a524 100644 --- a/node_modules/pacote/package.json +++ b/node_modules/pacote/package.json @@ -1,8 +1,8 @@ { - "_from": "pacote@~2.7.9", - "_id": "pacote@2.7.10", + "_from": "pacote@~2.7.10", + "_id": "pacote@2.7.11", "_inBundle": false, - "_integrity": "sha512-XW+bJC7y7foWYtaD0rkMi04mhktBG8I2y0N/vEUQN2R25dqVM7iV+fIdnUmNcnVDQHUIWK1XnodKEFIC4K+C6A==", + "_integrity": "sha512-A7FBCn2+/cVzlNEh7Sxushos7ay6+OsoC8Z57m/CTxKDI+/oJoRu3opx1Z8mLrCCe6lTk7DqPCjgQAoymyWgDA==", "_location": "/pacote", "_phantomChildren": { "cacache": "9.0.0", @@ -20,20 +20,20 @@ "_requested": { "type": "range", "registry": true, - "raw": "pacote@~2.7.9", + "raw": "pacote@~2.7.10", "name": "pacote", "escapedName": "pacote", - "rawSpec": "~2.7.9", + "rawSpec": "~2.7.10", "saveSpec": null, - "fetchSpec": "~2.7.9" + "fetchSpec": "~2.7.10" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/pacote/-/pacote-2.7.10.tgz", - "_shasum": "f5bb5994ff0c7b6f2e5164dd4fab996556231b99", - "_spec": "pacote@~2.7.9", + "_resolved": "https://registry.npmjs.org/pacote/-/pacote-2.7.11.tgz", + "_shasum": "39c06028e2a697f0c4ef8095c893bb503dd0f9fa", + "_spec": "pacote@~2.7.10", "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Kat Marchán", @@ -119,5 +119,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.10" + "version": "2.7.11" } |