/home2/dakshskx/nodejs/lib/node_modules/npm/node_modules/@npmcli/arborist/lib
NameSizeModeActions
arborist/-0755rm
add-rm-pkg-deps.js50100644editdlrm
audit-report.js122820644editdlrm
calc-dep-flags.js31480644editdlrm
can-place-dep.js142730644editdlrm
case-insensitive-map.js13560644editdlrm
consistent-resolve.js14320644editdlrm
debug.js12280644editdlrm
deepest-nesting-target.js6910644editdlrm
dep-valid.js49900644editdlrm
diff.js97980644editdlrm
edge.js69830644editdlrm
from-path.js10690644editdlrm
gather-dep-set.js12860644editdlrm
get-workspace-nodes.js8630644editdlrm
index.js3530644editdlrm
inventory.js32720644editdlrm
link.js36910644editdlrm
node.js440930644editdlrm
optional-set.js13530644editdlrm
override-resolves.js2300644editdlrm
override-set.js26030644editdlrm
peer-entry-sets.js26320644editdlrm
place-dep.js202070644editdlrm
printable.js52170644editdlrm
query-selector-all.js168270644editdlrm
realpath.js27370644editdlrm
relpath.js1310644editdlrm
reset-dep-flags.js6380644editdlrm
retire-path.js4910644editdlrm
shrinkwrap.js379130644editdlrm
signal-handling.js22450644editdlrm
signals.js13810644editdlrm
spec-from-lock.js8740644editdlrm
tracker.js33730644editdlrm
tree-check.js41210644editdlrm
version-from-tgz.js14890644editdlrm
vuln.js58580644editdlrm
yarn-lock.js102890644editdlrm
Edit: /home2/dakshskx/nodejs/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/optional-set.js (1353B)
// when an optional dep fails to install, we need to remove the branch of the // graph up to the first optionalDependencies, as well as any nodes that are // only required by other nodes in the set. // // This function finds the set of nodes that will need to be removed in that // case. // // Note that this is *only* going to work with trees where calcDepFlags // has been called, because we rely on the node.optional flag. const gatherDepSet = require('./gather-dep-set.js') const optionalSet = node => { if (!node.optional) { return new Set() } // start with the node, then walk up the dependency graph until we // get to the boundaries that define the optional set. since the // node is optional, we know that all paths INTO this area of the // graph are optional, but there may be non-optional dependencies // WITHIN the area. const set = new Set([node]) for (const node of set) { for (const edge of node.edgesIn) { if (!edge.optional) { set.add(edge.from) } } } // now that we've hit the boundary, gather the rest of the nodes in // the optional section. that's the set of dependencies that are only // depended upon by other nodes within the set, or optional dependencies // from outside the set. return gatherDepSet(set, edge => !edge.optional) } module.exports = optionalSet