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

Function buildPolicyFromNames

deps/npm/lib/utils/resolve-allow-scripts.js:7–17  ·  view source on GitHub ↗
(names)

Source from the content-addressed store, hash-verified

5const parseAllowScriptsList = require('@npmcli/config/lib/parse-allow-scripts-list.js')
6
7const buildPolicyFromNames = (names) => {
8 /* istanbul ignore if: callers only pass non-empty arrays */
9 if (!names.length) {
10 return null
11 }
12 const policy = {}
13 for (const name of names) {
14 policy[name] = true
15 }
16 return policy
17}
18
19// Read the `allow-scripts` value from one or more named config sources and
20// build a policy object. Returns `null` if none of the sources has a value.

Callers 1

policyFromSourcesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…