XylotrechusZ

XylotrechusZ Shell

: /lib/node_modules/npm/lib/install/ [ drwxr-xr-x ]
Uname: Linux premium294.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 8.1.32 [ PHP INFO ] PHP os: Linux
Server Ip: 104.21.80.1
Your Ip: 216.73.216.223
User: mjbynoyq (1574) | Group: mjbynoyq (1570)
Safe Mode: OFF
Disable Function:
NONE

name : is-only-optional.js
'use strict'
module.exports = isOptional

const isOptDep = require('./is-opt-dep.js')
const moduleName = require('../utils/module-name.js')

function isOptional (node, seen) {
  if (!seen) seen = new Set()
  // If a node is not required by anything, then we've reached
  // the top level package.
  if (seen.has(node) || node.requiredBy.length === 0) {
    return false
  }
  seen.add(node)
  const swOptional = node.fromShrinkwrap && node.package._optional
  const result = node.requiredBy.every(function (req) {
    if (req.fakeChild && swOptional) return true
    return isOptDep(req, moduleName(node)) || isOptional(req, seen)
  })
  seen.delete(node)
  return result
}
© 2025 XylotrechusZ