MCPcopy Create free account
hub / github.com/npm/cli / denyWarning

Function denyWarning

lib/utils/allow-scripts-writer.js:113–122  ·  view source on GitHub ↗
(key, subject, name)

Source from the content-addressed store, hash-verified

111// the user can either widen it via `npm install-scripts deny <name>` or
112// remove it to approve the currently-installed version only.
113const denyWarning = (key, subject, name) => {
114 if (isNameOnlyKey(key)) {
115 return `${key} is denied; remove the entry from allowScripts to approve ${subject}.`
116 }
117 /* istanbul ignore next: name fallback is defensive; callers pass nameKeyFor(sample) */
118 const widenTarget = name || 'this package'
119 return `${key} is a versioned deny; run \`npm install-scripts deny ${widenTarget}\` ` +
120 `to widen the deny to all versions of ${widenTarget}, or remove the entry ` +
121 `to approve ${subject}.`
122}
123
124const isNameOnlyKey = (key) => {
125 try {

Callers 1

applyApprovalForPackageFunction · 0.85

Calls 1

isNameOnlyKeyFunction · 0.85

Tested by

no test coverage detected