/
snap
/
node
/
11691
/
lib
/
node_modules
/
npm
/
node_modules
/
@npmcli
/
arborist
/
lib
/
/snap/node/11691/lib/node_modules/npm/node_modules/@npmcli/arborist/lib
mkdir
upload
Name
Size
Mode
Actions
arborist/
-
0755
rm
add-rm-pkg-deps.js
5008
0644
edit
dl
rm
audit-report.js
12232
0644
edit
dl
rm
calc-dep-flags.js
3506
0644
edit
dl
rm
can-place-dep.js
14273
0644
edit
dl
rm
case-insensitive-map.js
1239
0644
edit
dl
rm
consistent-resolve.js
1296
0644
edit
dl
rm
debug.js
1282
0644
edit
dl
rm
deepest-nesting-target.js
691
0644
edit
dl
rm
dep-valid.js
5125
0644
edit
dl
rm
diff.js
10005
0644
edit
dl
rm
edge.js
6784
0644
edit
dl
rm
from-path.js
1095
0644
edit
dl
rm
gather-dep-set.js
1286
0644
edit
dl
rm
index.js
273
0644
edit
dl
rm
inventory.js
3321
0644
edit
dl
rm
isolated-classes.js
2717
0644
edit
dl
rm
link.js
3114
0644
edit
dl
rm
node.js
44529
0644
edit
dl
rm
optional-set.js
1353
0644
edit
dl
rm
override-resolves.js
225
0644
edit
dl
rm
override-set.js
8567
0644
edit
dl
rm
packument-cache.js
2556
0644
edit
dl
rm
peer-entry-sets.js
2632
0644
edit
dl
rm
place-dep.js
20226
0644
edit
dl
rm
printable.js
5222
0644
edit
dl
rm
query-selector-all.js
29903
0644
edit
dl
rm
realpath.js
2655
0644
edit
dl
rm
relpath.js
136
0644
edit
dl
rm
reset-dep-flags.js
638
0644
edit
dl
rm
retire-path.js
501
0644
edit
dl
rm
shrinkwrap.js
37711
0644
edit
dl
rm
signal-handling.js
2245
0644
edit
dl
rm
signals.js
1381
0644
edit
dl
rm
spec-from-lock.js
874
0644
edit
dl
rm
tracker.js
2991
0644
edit
dl
rm
tree-check.js
4142
0644
edit
dl
rm
version-from-tgz.js
1488
0644
edit
dl
rm
vuln.js
5958
0644
edit
dl
rm
yarn-lock.js
10813
0644
edit
dl
rm
Edit:
/snap/node/11691/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/link.js
(3114B)
const relpath = require('./relpath.js') const Node = require('./node.js') const _loadDeps = Symbol.for('Arborist.Node._loadDeps') const _target = Symbol.for('_target') const { dirname } = require('node:path') // defined by Node class const _delistFromMeta = Symbol.for('_delistFromMeta') const _refreshLocation = Symbol.for('_refreshLocation') class Link extends Node { constructor (options) { const { root, realpath, target, parent, fsParent, isStoreLink } = options if (!realpath && !(target && target.path)) { throw new TypeError('must provide realpath for Link node') } super({ ...options, realpath: realpath || target.path, root: root || (parent ? parent.root : fsParent ? fsParent.root : target ? target.root : null), }) this.isStoreLink = isStoreLink || false if (target) { this.target = target } else if (this.realpath === this.root.path) { this.target = this.root } else { this.target = new Node({ ...options, path: realpath, parent: null, fsParent: null, root: this.root, }) } } get version () { return this.target ? this.target.version : this.package.version || '' } get target () { return this[_target] } set target (target) { const current = this[_target] if (target === current) { return } if (!target) { if (current && current.linksIn) { current.linksIn.delete(this) } if (this.path) { this[_delistFromMeta]() this[_target] = null this.package = {} this[_refreshLocation]() } else { this[_target] = null } return } if (!this.path) { // temp node pending assignment to a tree // we know it's not in the inventory yet, because no path. if (target.path) { this.realpath = target.path } else { target.path = target.realpath = this.realpath } target.root = this.root this[_target] = target target.linksIn.add(this) this.package = target.package return } // have to refresh metadata, because either realpath or package // is very likely changing. this[_delistFromMeta]() this.package = target.package this.realpath = target.path this[_refreshLocation]() target.root = this.root } // a link always resolves to the relative path to its target get resolved () { // the path/realpath guard is there for the benefit of setting // these things in the "wrong" order return this.path && this.realpath ? `file:${relpath(dirname(this.path), this.realpath)}` : null } set resolved (r) {} // deps are resolved on the target, not the Link // so this is a no-op [_loadDeps] () {} // links can't have children, only their targets can // fix it to an empty list so that we can still call // things that iterate over them, just as a no-op get children () { return new Map() } set children (c) {} get isLink () { return true } } module.exports = Link
Save
cmd:
run