| Server IP : 121.121.20.254 / Your IP : 216.73.216.182 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Program Files/nodejs/node_modules/npm/node_modules/@npmcli/config/lib/ |
Upload File : |
// Parse an `allow-scripts` raw config value (string or array of strings)
// into a flat array of trimmed package-spec entries. Shared between the
// CLI/env layer (via the `allow-scripts` definition's `flatten`) and the
// package.json / .npmrc layer (in lib/utils/resolve-allow-scripts.js) so
// both paths agree on quoting, whitespace, and duplicate handling.
const parseAllowScriptsList = (raw) => {
const parts = []
const entries = Array.isArray(raw) ? raw : (typeof raw === 'string' ? [raw] : [])
for (const entry of entries) {
if (typeof entry !== 'string') {
continue
}
for (const part of entry.split(',')) {
const trimmed = part.trim()
if (trimmed) {
parts.push(trimmed)
}
}
}
return parts
}
module.exports = parseAllowScriptsList