MCPcopy Index your code
hub / github.com/nodejs/node / findWorkspaceAllowScripts

Function findWorkspaceAllowScripts

deps/npm/lib/utils/warn-workspace-allow-scripts.js:11–25  ·  view source on GitHub ↗
(tree)

Source from the content-addressed store, hash-verified

9// install-time `log.warn` per offender.
10
11const 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
27const warnWorkspaceAllowScripts = (tree) => {
28 for (const node of findWorkspaceAllowScripts(tree)) {

Calls 2

valuesMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected