Skip to content

Commit ebe5abd

Browse files
committed
deps: pacote@21.1.0
1 parent f8d25cd commit ebe5abd

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

node_modules/pacote/lib/fetcher.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,11 +469,31 @@ const FileFetcher = require('./file.js')
469469
const DirFetcher = require('./dir.js')
470470
const RemoteFetcher = require('./remote.js')
471471

472+
// possible values for allow: 'all', 'root', 'none'
473+
const canUseGit = (allow = 'all', isRoot = false) => {
474+
if (allow === 'all') {
475+
return true
476+
}
477+
if (allow !== 'none' && isRoot) {
478+
return true
479+
}
480+
return false
481+
}
482+
472483
// Get an appropriate fetcher object from a spec and options
473484
FetcherBase.get = (rawSpec, opts = {}) => {
474485
const spec = npa(rawSpec, opts.where)
475486
switch (spec.type) {
476487
case 'git':
488+
if (!canUseGit(opts.allowGit, opts._isRoot)) {
489+
throw Object.assign(
490+
new Error(`Fetching${opts.allowGit === 'root' ? ' non-root' : ''} packages from git has been disabled`),
491+
{
492+
code: 'EALLOWGIT',
493+
package: spec.toString(),
494+
}
495+
)
496+
}
477497
return new GitFetcher(spec, opts)
478498

479499
case 'remote':

node_modules/pacote/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pacote",
3-
"version": "21.0.4",
3+
"version": "21.1.0",
44
"description": "JavaScript package downloader",
55
"author": "GitHub Inc.",
66
"bin": {

package-lock.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
"npm-registry-fetch": "^19.1.1",
136136
"npm-user-validate": "^4.0.0",
137137
"p-map": "^7.0.4",
138-
"pacote": "^21.0.4",
138+
"pacote": "^21.1.0",
139139
"parse-conflict-json": "^5.0.1",
140140
"proc-log": "^6.1.0",
141141
"qrcode-terminal": "^0.12.0",
@@ -9232,9 +9232,9 @@
92329232
"license": "BlueOak-1.0.0"
92339233
},
92349234
"node_modules/pacote": {
9235-
"version": "21.0.4",
9236-
"resolved": "https://registry.npmjs.org/pacote/-/pacote-21.0.4.tgz",
9237-
"integrity": "sha512-RplP/pDW0NNNDh3pnaoIWYPvNenS7UqMbXyvMqJczosiFWTeGGwJC2NQBLqKf4rGLFfwCOnntw1aEp9Jiqm1MA==",
9235+
"version": "21.1.0",
9236+
"resolved": "https://registry.npmjs.org/pacote/-/pacote-21.1.0.tgz",
9237+
"integrity": "sha512-WF/PwrImIIVaLmtuCeO5L7n6DA0ZGCqmDPO/XbNjZgNUX+2O5z4f4Wdmu6erBWNICkl3ftKJvit2eIVcpegRRw==",
92389238
"inBundle": true,
92399239
"license": "ISC",
92409240
"dependencies": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"npm-registry-fetch": "^19.1.1",
103103
"npm-user-validate": "^4.0.0",
104104
"p-map": "^7.0.4",
105-
"pacote": "^21.0.4",
105+
"pacote": "^21.1.0",
106106
"parse-conflict-json": "^5.0.1",
107107
"proc-log": "^6.1.0",
108108
"qrcode-terminal": "^0.12.0",

0 commit comments

Comments
 (0)