(tree)
| 9 | // install-time `log.warn` per offender. |
| 10 | |
| 11 | const findWorkspaceAllowScripts = (tree) => { |
| 12 | const offenders = [] |
| 13 | if (!tree?.inventory) { |
| 14 | return offenders |
| 15 | } |
| 16 | for (const node of tree.inventory.values()) { |
| 17 | if (!node.isWorkspace || node.isProjectRoot) { |
| 18 | continue |
| 19 | } |
| 20 | if (node.package?.allowScripts !== undefined) { |
| 21 | offenders.push(node) |
| 22 | } |
| 23 | } |
| 24 | return offenders |
| 25 | } |
| 26 | |
| 27 | const warnWorkspaceAllowScripts = (tree) => { |
| 28 | for (const node of findWorkspaceAllowScripts(tree)) { |
no test coverage detected