Socket
Socket
Sign inDemoInstall

pacote

Package Overview
Dependencies
Maintainers
1
Versions
220
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pacote - npm Package Compare versions

Comparing version 2.7.10 to 2.7.11

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<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>

@@ -7,0 +17,0 @@ ## [2.7.10](https://github.com/zkat/pacote/compare/v2.7.9...v2.7.10) (2017-05-12)

55

lib/fetch.js

@@ -29,13 +29,2 @@ 'use strict'

const TYPES = new Set([
'directory',
'file',
'git',
'hosted',
'range',
'remote',
'tag',
'version'
])
const fetchers = {}

@@ -51,15 +40,35 @@

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]
}
{
"name": "pacote",
"version": "2.7.10",
"version": "2.7.11",
"description": "JavaScript package downloader",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc