HEX
Server: Apache/2
System: Linux nexus-01 4.18.0-553.120.1.el8_10.x86_64 #1 SMP Mon Apr 20 18:04:27 EDT 2026 x86_64
User: aglcoke (1118)
PHP: 8.2.31
Disabled: mail,exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //lib/node_modules/npm/node_modules/@npmcli/arborist/lib/isolated-classes.js
// Alternate versions of different classes that we use for isolated mode
const CaseInsensitiveMap = require('./case-insensitive-map.js')
const { resolve } = require('node:path')

// fake lib/inventory.js
class IsolatedInventory extends Map {
  query () {
    return []
  }
}

// fake lib/node.js
class IsolatedNode {
  binPaths = []
  children = new CaseInsensitiveMap()
  edgesIn = new Set()
  edgesOut = new CaseInsensitiveMap()
  fsChildren = new Set()
  hasShrinkwrap = false
  integrity = null
  inventory = new IsolatedInventory()
  isInStore = false
  linksIn = new Set()
  meta = { loadedFromDisk: false }
  optional = false
  parent = null
  root = null
  tops = new Set()
  workspaces = new Map()

  constructor (options) {
    this.location = options.location
    this.name = options.name
    this.package = options.package
    this.path = options.path
    this.realpath = !this.isLink ? this.path : resolve(options.realpath)

    if (options.parent) {
      this.parent = options.parent
    }
    if (options.resolved) {
      this.resolved = options.resolved
    }
    if (options.root) {
      this.root = options.root
    }
    if (options.isInStore) {
      this.isInStore = true
    }
    if (options.optional) {
      this.optional = true
    }
  }

  get isRoot () {
    return this === this.root
  }

  // The idealGraph is where this is set to true
  get isProjectRoot () {
    return false
  }

  get inDepBundle () {
    return false
  }

  get isLink () {
    return false
  }

  get isTop () {
    return !this.parent
  }

  /* istanbul ignore next -- emulate lib/node.js */
  get global () {
    return false
  }

  get globalTop () {
    return false
  }

  /* istanbul ignore next -- emulate lib/node.js */
  set target (t) {
    // nop
    // In the real lib/node.js this throws in debug mode
  }

  get target () {
    return this
  }

  /* istanbul ignore next -- emulate lib/node.js */
  getBundler () {
    return null
  }

  /* istanbul ignore next -- emulate lib/node.js */
  get hasInstallScript () {
    const { hasInstallScript, scripts } = this.package
    const { install, preinstall, postinstall } = scripts || {}
    return !!(hasInstallScript || install || preinstall || postinstall)
  }

  get version () {
    return this.package.version
  }
}

// fake lib/link.js
class IsolatedLink extends IsolatedNode {
  #target
  isStoreLink = false

  constructor (options) {
    super(options)
    this.#target = options.target
    if (options.isStoreLink) {
      this.isStoreLink = true
    }
  }

  get isLink () {
    return true
  }

  set target (t) {
    this.#target = t
  }

  get target () {
    return this.#target
  }
}

module.exports = { IsolatedNode, IsolatedLink }