(key, subject, name)
| 111 | // the user can either widen it via `npm deny-scripts <name>` or remove |
| 112 | // it to approve the currently-installed version only. |
| 113 | const 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 deny-scripts ${widenTarget}\` ` + |
| 120 | `to widen the deny to all versions of ${widenTarget}, or remove the entry ` + |
| 121 | `to approve ${subject}.` |
| 122 | } |
| 123 | |
| 124 | const isNameOnlyKey = (key) => { |
| 125 | try { |
no test coverage detected
searching dependent graphs…