/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/tracker.js (3373B)
const _progress = Symbol('_progress') const _onError = Symbol('_onError') const _setProgress = Symbol('_setProgess') const npmlog = require('npmlog') module.exports = cls => class Tracker extends cls { constructor (options = {}) { super(options) this[_setProgress] = !!options.progress this[_progress] = new Map() } 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 tracker from npmlog // starts progress bar if (this[_setProgress] && this[_progress].size === 0) { npmlog.enableProgress() } this[_progress].set(section, npmlog.newGroup(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 in this[_progress] from parent tracker this[_progress].set(`${section}:${key}`, this[_progress].get(section).newGroup(`${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() this[_progress].delete(section) // remove progress bar if all // trackers are finished if (this[_setProgress] && this[_progress].size === 0) { npmlog.disableProgress() } } 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] this[_progress].get(`${section}:${key}`).finish() this[_progress].delete(`${section}:${key}`) } // 3. existing parent tracker, no subsection } [_onError] (msg) { if (this[_setProgress]) { npmlog.disableProgress() } throw new Error(msg) } }