PHP 8.3.31
Preview: isolated-classes.js Size: 2.65 KB
/opt/alt/alt-nodejs24/root/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 }

Directory Contents

Dirs: 1 × Files: 39

Name Size Perms Modified Actions
arborist DIR
- drwxr-xr-x 2026-05-14 18:53:29
Edit Download
4.89 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
9.39 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
3.28 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
13.94 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
1.21 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
1.22 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
1.25 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
691 B lrw-r--r-- 2026-04-24 15:56:03
Edit Download
5.01 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
10.08 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
9.75 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
1.07 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
1.26 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
273 B lrw-r--r-- 2026-04-24 15:56:03
Edit Download
3.24 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
2.65 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
3.04 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
48.66 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
1.17 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
225 B lrw-r--r-- 2026-04-24 15:56:03
Edit Download
8.57 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
2.50 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
2.57 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
19.78 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
5.10 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
29.65 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
2.59 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
136 B lrw-r--r-- 2026-04-24 15:56:03
Edit Download
542 B lrw-r--r-- 2026-04-24 15:56:03
Edit Download
501 B lrw-r--r-- 2026-04-24 15:56:03
Edit Download
36.84 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
2.19 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
1.35 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
874 B lrw-r--r-- 2026-04-24 15:56:03
Edit Download
2.92 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
4.04 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
1.45 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
5.82 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download
10.56 KB lrw-r--r-- 2026-04-24 15:56:03
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).