/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/tracker.js (2991B)
const proggy = require('proggy') module.exports = cls => class Tracker extends cls { #progress = new Map() #createTracker (key, name) { const tracker = new proggy.Tracker(name ?? key) tracker.on('done', () => this.#progress.delete(key)) this.#progress.set(key, tracker) } addTracker (section, subsection = null, key = null) { if (section === null || section === undefined) { this.#onError(`Tracker can't be null or undefined`) } if (key === null) { key = subsection } const hasTracker = this.#progress.has(section) const hasSubtracker = this.#progress.has(`${section}:${key}`) if (hasTracker && subsection === null) { // 0. existing tracker, no subsection this.#onError(`Tracker "${section}" already exists`) } else if (!hasTracker && subsection === null) { // 1. no existing tracker, no subsection // Create a new progress tracker this.#createTracker(section) } else if (!hasTracker && subsection !== null) { // 2. no parent tracker and subsection this.#onError(`Parent tracker "${section}" does not exist`) } else if (!hasTracker || !hasSubtracker) { // 3. existing parent tracker, no subsection tracker // Create a new subtracker and update parents const parentTracker = this.#progress.get(section) parentTracker.update(parentTracker.value, parentTracker.total + 1) this.#createTracker(`${section}:${key}`, `${section}:${subsection}`) } // 4. existing parent tracker, existing subsection tracker // skip it } finishTracker (section, subsection = null, key = null) { if (section === null || section === undefined) { this.#onError(`Tracker can't be null or undefined`) } if (key === null) { key = subsection } const hasTracker = this.#progress.has(section) const hasSubtracker = this.#progress.has(`${section}:${key}`) // 0. parent tracker exists, no subsection // Finish parent tracker and remove from this.#progress if (hasTracker && subsection === null) { // check if parent tracker does // not have any remaining children const keys = this.#progress.keys() for (const key of keys) { if (key.match(new RegExp(section + ':'))) { this.finishTracker(section, key) } } // remove parent tracker this.#progress.get(section).finish() } else if (!hasTracker && subsection === null) { // 1. no existing parent tracker, no subsection this.#onError(`Tracker "${section}" does not exist`) } else if (!hasTracker || hasSubtracker) { // 2. subtracker exists // Finish subtracker and remove from this.#progress const parentTracker = this.#progress.get(section) parentTracker.update(parentTracker.value + 1) this.#progress.get(`${section}:${key}`).finish() } // 3. existing parent tracker, no subsection } #onError (msg) { throw new Error(msg) } }