(nodes)
| 225 | } |
| 226 | |
| 227 | groupByPackage (nodes) { |
| 228 | const groups = {} |
| 229 | for (const node of nodes) { |
| 230 | const key = nameKeyFor(node) |
| 231 | /* istanbul ignore if: callers prefilter via inBundle and trustedDisplay so untrusted nodes don't reach here */ |
| 232 | if (!key) { |
| 233 | log.warn( |
| 234 | this.logTitle, |
| 235 | `skipping ${node.name || '<unknown>'}: no trusted identity for policy key` |
| 236 | ) |
| 237 | continue |
| 238 | } |
| 239 | if (!groups[key]) { |
| 240 | groups[key] = [] |
| 241 | } |
| 242 | groups[key].push(node) |
| 243 | } |
| 244 | return groups |
| 245 | } |
| 246 | |
| 247 | async writePolicyChanges (groups) { |
| 248 | const pin = this.npm.config.get('allow-scripts-pin') !== false |
no test coverage detected