/
home2
/
dakshskx
/
nodejs
/
lib
/
node_modules
/
npm
/
node_modules
/
@npmcli
/
arborist
/
lib
/
/home2/dakshskx/nodejs/lib/node_modules/npm/node_modules/@npmcli/arborist/lib
mkdir
upload
Name
Size
Mode
Actions
arborist/
-
0755
rm
add-rm-pkg-deps.js
5010
0644
edit
dl
rm
audit-report.js
12282
0644
edit
dl
rm
calc-dep-flags.js
3148
0644
edit
dl
rm
can-place-dep.js
14273
0644
edit
dl
rm
case-insensitive-map.js
1356
0644
edit
dl
rm
consistent-resolve.js
1432
0644
edit
dl
rm
debug.js
1228
0644
edit
dl
rm
deepest-nesting-target.js
691
0644
edit
dl
rm
dep-valid.js
4990
0644
edit
dl
rm
diff.js
9798
0644
edit
dl
rm
edge.js
6983
0644
edit
dl
rm
from-path.js
1069
0644
edit
dl
rm
gather-dep-set.js
1286
0644
edit
dl
rm
get-workspace-nodes.js
863
0644
edit
dl
rm
index.js
353
0644
edit
dl
rm
inventory.js
3272
0644
edit
dl
rm
link.js
3691
0644
edit
dl
rm
node.js
44093
0644
edit
dl
rm
optional-set.js
1353
0644
edit
dl
rm
override-resolves.js
230
0644
edit
dl
rm
override-set.js
2603
0644
edit
dl
rm
peer-entry-sets.js
2632
0644
edit
dl
rm
place-dep.js
20207
0644
edit
dl
rm
printable.js
5217
0644
edit
dl
rm
query-selector-all.js
16827
0644
edit
dl
rm
realpath.js
2737
0644
edit
dl
rm
relpath.js
131
0644
edit
dl
rm
reset-dep-flags.js
638
0644
edit
dl
rm
retire-path.js
491
0644
edit
dl
rm
shrinkwrap.js
37913
0644
edit
dl
rm
signal-handling.js
2245
0644
edit
dl
rm
signals.js
1381
0644
edit
dl
rm
spec-from-lock.js
874
0644
edit
dl
rm
tracker.js
3373
0644
edit
dl
rm
tree-check.js
4121
0644
edit
dl
rm
version-from-tgz.js
1489
0644
edit
dl
rm
vuln.js
5858
0644
edit
dl
rm
yarn-lock.js
10289
0644
edit
dl
rm
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) } }
Save
cmd:
run