(nodes)
| 253 | } |
| 254 | |
| 255 | groupByPackage (nodes) { |
| 256 | const groups = {} |
| 257 | for (const node of nodes) { |
| 258 | const key = nameKeyFor(node) |
| 259 | /* istanbul ignore if: callers prefilter via inBundle and trustedDisplay so untrusted nodes don't reach here */ |
| 260 | if (!key) { |
| 261 | log.warn( |
| 262 | this.logTitle, |
| 263 | `skipping ${node.name || '<unknown>'}: no trusted identity for policy key` |
| 264 | ) |
| 265 | continue |
| 266 | } |
| 267 | if (!groups[key]) { |
| 268 | groups[key] = [] |
| 269 | } |
| 270 | groups[key].push(node) |
| 271 | } |
| 272 | return groups |
| 273 | } |
| 274 | |
| 275 | async writePolicyChanges (groups) { |
| 276 | const pin = this.npm.config.get('allow-scripts-pin') !== false |
no test coverage detected