/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/consistent-resolve.js (1432B)
// take a path and a resolved value, and turn it into a resolution from // the given new path. This is used with converting a package.json's // relative file: path into one suitable for a lockfile, or between // lockfiles, and for converting hosted git repos to a consistent url type. const npa = require('npm-package-arg') const relpath = require('./relpath.js') const consistentResolve = (resolved, fromPath, toPath, relPaths = false) => { if (!resolved) { return null } try { const hostedOpt = { noCommittish: false } const { fetchSpec, saveSpec, type, hosted, rawSpec, raw, } = npa(resolved, fromPath) const isPath = type === 'file' || type === 'directory' return isPath && !relPaths ? `file:${fetchSpec.replace(/#/g, '%23')}` : isPath ? 'file:' + (toPath ? relpath(toPath, fetchSpec.replace(/#/g, '%23')) : fetchSpec.replace(/#/g, '%23')) : hosted ? `git+${ hosted.auth ? hosted.https(hostedOpt) : hosted.sshurl(hostedOpt) }` : type === 'git' ? saveSpec // always return something. 'foo' is interpreted as 'foo@' otherwise. : rawSpec === '' && raw.slice(-1) !== '@' ? raw // just strip off the name, but otherwise return as-is : rawSpec } catch (_) { // whatever we passed in was not acceptable to npa. // leave it 100% untouched. return resolved } } module.exports = consistentResolve