$68 GRAYBYTE WORDPRESS FILE MANAGER $99

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cpanel/ea-nodejs22/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/

HOME
Current File : /opt/cpanel/ea-nodejs22/lib/node_modules/npm/node_modules/@npmcli/arborist/lib//tree-check.js
const debug = require('./debug.js')

const checkTree = (tree, checkUnreachable = true) => {
  const log = [['START TREE CHECK', tree.path]]

  // this can only happen in tests where we have a "tree" object
  // that isn't actually a tree.
  if (!tree.root || !tree.root.inventory) {
    return tree
  }

  const { inventory } = tree.root
  const seen = new Set()
  const check = (node, via = tree, viaType = 'self') => {
    log.push([
      'CHECK',
      node && node.location,
      via && via.location,
      viaType,
      'seen=' + seen.has(node),
      'promise=' + !!(node && node.then),
      'root=' + !!(node && node.isRoot),
    ])

    if (!node || seen.has(node) || node.then) {
      return
    }

    seen.add(node)

    if (node.isRoot && node !== tree.root) {
      throw Object.assign(new Error('double root'), {
        node: node.path,
        realpath: node.realpath,
        tree: tree.path,
        root: tree.root.path,
        via: via.path,
        viaType,
        log,
      })
    }

    if (node.root !== tree.root) {
      throw Object.assign(new Error('node from other root in tree'), {
        node: node.path,
        realpath: node.realpath,
        tree: tree.path,
        root: tree.root.path,
        via: via.path,
        viaType,
        otherRoot: node.root && node.root.path,
        log,
      })
    }

    if (!node.isRoot && node.inventory.size !== 0) {
      throw Object.assign(new Error('non-root has non-zero inventory'), {
        node: node.path,
        tree: tree.path,
        root: tree.root.path,
        via: via.path,
        viaType,
        inventory: [...node.inventory.values()].map(node =>
          [node.path, node.location]),
        log,
      })
    }

    if (!node.isRoot && !inventory.has(node) && !node.dummy) {
      throw Object.assign(new Error('not in inventory'), {
        node: node.path,
        tree: tree.path,
        root: tree.root.path,
        via: via.path,
        viaType,
        log,
      })
    }

    const devEdges = [...node.edgesOut.values()].filter(e => e.dev)
    if (!node.isTop && devEdges.length) {
      throw Object.assign(new Error('dev edges on non-top node'), {
        node: node.path,
        tree: tree.path,
        root: tree.root.path,
        via: via.path,
        viaType,
        devEdges: devEdges.map(e => [e.type, e.name, e.spec, e.error]),
        log,
      })
    }

    if (node.path === tree.root.path && node !== tree.root && !tree.root.isLink) {
      throw Object.assign(new Error('node with same path as root'), {
        node: node.path,
        tree: tree.path,
        root: tree.root.path,
        via: via.path,
        viaType,
        log,
      })
    }

    if (!node.isLink && node.path !== node.realpath) {
      throw Object.assign(new Error('non-link with mismatched path/realpath'), {
        node: node.path,
        tree: tree.path,
        realpath: node.realpath,
        root: tree.root.path,
        via: via.path,
        viaType,
        log,
      })
    }

    const { parent, fsParent, target } = node
    check(parent, node, 'parent')
    check(fsParent, node, 'fsParent')
    check(target, node, 'target')
    log.push(['CHILDREN', node.location, ...node.children.keys()])
    for (const kid of node.children.values()) {
      check(kid, node, 'children')
    }
    for (const kid of node.fsChildren) {
      check(kid, node, 'fsChildren')
    }
    for (const link of node.linksIn) {
      check(link, node, 'linksIn')
    }
    for (const top of node.tops) {
      check(top, node, 'tops')
    }
    log.push(['DONE', node.location])
  }
  check(tree)
  if (checkUnreachable) {
    for (const node of inventory.values()) {
      if (!seen.has(node) && node !== tree.root) {
        throw Object.assign(new Error('unreachable in inventory'), {
          node: node.path,
          realpath: node.realpath,
          location: node.location,
          root: tree.root.path,
          tree: tree.path,
          log,
        })
      }
    }
  }
  return tree
}

// should only ever run this check in debug mode
module.exports = tree => tree
debug(() => module.exports = checkTree)

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
1 Jan 1970 8.00 AM
root / root
0
arborist
--
16 Mar 2026 5.04 PM
root / root
0755
add-rm-pkg-deps.js
4.891 KB
17 Jan 2026 1.16 AM
root / root
0644
audit-report.js
11.945 KB
17 Jan 2026 1.16 AM
root / root
0644
calc-dep-flags.js
3.424 KB
17 Jan 2026 1.16 AM
root / root
0644
can-place-dep.js
13.938 KB
17 Jan 2026 1.16 AM
root / root
0644
case-insensitive-map.js
1.21 KB
17 Jan 2026 1.16 AM
root / root
0644
consistent-resolve.js
1.266 KB
17 Jan 2026 1.16 AM
root / root
0644
debug.js
1.252 KB
17 Jan 2026 1.16 AM
root / root
0644
deepest-nesting-target.js
0.675 KB
17 Jan 2026 1.16 AM
root / root
0644
dep-valid.js
5.005 KB
17 Jan 2026 1.16 AM
root / root
0644
diff.js
9.573 KB
17 Jan 2026 1.16 AM
root / root
0644
edge.js
6.625 KB
17 Jan 2026 1.16 AM
root / root
0644
from-path.js
1.069 KB
17 Jan 2026 1.16 AM
root / root
0644
gather-dep-set.js
1.256 KB
17 Jan 2026 1.16 AM
root / root
0644
index.js
0.267 KB
17 Jan 2026 1.16 AM
root / root
0644
inventory.js
3.246 KB
17 Jan 2026 1.16 AM
root / root
0644
link.js
3.041 KB
17 Jan 2026 1.16 AM
root / root
0644
node.js
42.95 KB
17 Jan 2026 1.16 AM
root / root
0644
optional-set.js
1.321 KB
17 Jan 2026 1.16 AM
root / root
0644
override-resolves.js
0.22 KB
17 Jan 2026 1.16 AM
root / root
0644
override-set.js
3.115 KB
17 Jan 2026 1.16 AM
root / root
0644
packument-cache.js
2.496 KB
17 Jan 2026 1.16 AM
root / root
0644
peer-entry-sets.js
2.57 KB
17 Jan 2026 1.16 AM
root / root
0644
place-dep.js
19.752 KB
17 Jan 2026 1.16 AM
root / root
0644
printable.js
5.1 KB
17 Jan 2026 1.16 AM
root / root
0644
query-selector-all.js
28.841 KB
17 Jan 2026 1.16 AM
root / root
0644
realpath.js
2.593 KB
17 Jan 2026 1.16 AM
root / root
0644
relpath.js
0.133 KB
17 Jan 2026 1.16 AM
root / root
0644
reset-dep-flags.js
0.623 KB
17 Jan 2026 1.16 AM
root / root
0644
retire-path.js
0.489 KB
17 Jan 2026 1.16 AM
root / root
0644
shrinkwrap.js
36.827 KB
17 Jan 2026 1.16 AM
root / root
0644
signal-handling.js
2.192 KB
17 Jan 2026 1.16 AM
root / root
0644
signals.js
1.349 KB
17 Jan 2026 1.16 AM
root / root
0644
spec-from-lock.js
0.854 KB
17 Jan 2026 1.16 AM
root / root
0644
tracker.js
2.921 KB
17 Jan 2026 1.16 AM
root / root
0644
tree-check.js
4.045 KB
17 Jan 2026 1.16 AM
root / root
0644
version-from-tgz.js
1.453 KB
17 Jan 2026 1.16 AM
root / root
0644
vuln.js
5.818 KB
17 Jan 2026 1.16 AM
root / root
0644
yarn-lock.js
10.56 KB
17 Jan 2026 1.16 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF