📁 File Manager Pro
v10.0.2 | PHP: 8.1.34
Server: LiteSpeed
2026-06-28 14:37:12
📂
/
/
opt
/
alt
/
alt-nodejs24
/
root
/
usr
/
lib
/
node_modules
/
npm
/
node_modules.bundled
/
@npmcli
/
arborist
/
lib
✏️
Editing: deepest-nesting-target.js
// given a starting node, what is the *deepest* target where name could go? // This is not on the Node class for the simple reason that we sometimes // need to check the deepest *potential* target for a Node that is not yet // added to the tree where we are checking. const deepestNestingTarget = (start, name) => { for (const target of start.ancestry()) { // note: this will skip past the first target if edge is peer if (target.isProjectRoot || !target.resolveParent || target.globalTop) { return target } const targetEdge = target.edgesOut.get(name) if (!targetEdge || !targetEdge.peer) { return target } } } module.exports = deepestNestingTarget
💾 Save Changes
❌ Cancel