/snap/node/11691/lib/node_modules/npm/node_modules/@npmcli/arborist/lib
NameSizeModeActions
arborist/-0755rm
add-rm-pkg-deps.js50080644editdlrm
audit-report.js122320644editdlrm
calc-dep-flags.js35060644editdlrm
can-place-dep.js142730644editdlrm
case-insensitive-map.js12390644editdlrm
consistent-resolve.js12960644editdlrm
debug.js12820644editdlrm
deepest-nesting-target.js6910644editdlrm
dep-valid.js51250644editdlrm
diff.js100050644editdlrm
edge.js67840644editdlrm
from-path.js10950644editdlrm
gather-dep-set.js12860644editdlrm
index.js2730644editdlrm
inventory.js33210644editdlrm
isolated-classes.js27170644editdlrm
link.js31140644editdlrm
node.js445290644editdlrm
optional-set.js13530644editdlrm
override-resolves.js2250644editdlrm
override-set.js85670644editdlrm
packument-cache.js25560644editdlrm
peer-entry-sets.js26320644editdlrm
place-dep.js202260644editdlrm
printable.js52220644editdlrm
query-selector-all.js299030644editdlrm
realpath.js26550644editdlrm
relpath.js1360644editdlrm
reset-dep-flags.js6380644editdlrm
retire-path.js5010644editdlrm
shrinkwrap.js377110644editdlrm
signal-handling.js22450644editdlrm
signals.js13810644editdlrm
spec-from-lock.js8740644editdlrm
tracker.js29910644editdlrm
tree-check.js41420644editdlrm
version-from-tgz.js14880644editdlrm
vuln.js59580644editdlrm
yarn-lock.js108130644editdlrm
Edit: /snap/node/11691/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/from-path.js (1095B)
// file dependencies need their dependencies resolved based on the location // where the tarball was found, not the location where they end up getting // installed. directory (ie, symlink) deps also need to be resolved based on // their targets, but that's what realpath is const { dirname } = require('node:path') const npa = require('npm-package-arg') const fromPath = (node, edge) => { if (edge && edge.overrides && edge.overrides.name === edge.name && edge.overrides.value) { // fromPath could be called with a node that has a virtual root, if that // happens we want to make sure we get the real root node when overrides // are in use. this is to allow things like overriding a dependency with a // tarball file that's a relative path from the project root if (node.sourceReference) { return node.sourceReference.root.realpath } return node.root.realpath } if (node.resolved) { const spec = npa(node.resolved) if (spec?.type === 'file') { return dirname(spec.fetchSpec) } } return node.realpath } module.exports = fromPath