%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
const { resolve } = require('path') const Arborist = require('@npmcli/arborist') const localeCompare = require('@isaacs/string-locale-compare')('en') const installedDeep = async (npm) => { const { depth, global, prefix, workspacesEnabled, } = npm.flatOptions const getValues = (tree) => [...tree.inventory.values()] .filter(i => i.location !== '' && !i.isRoot) .map(i => { return i }) .filter(i => (i.depth - 1) <= depth) .sort((a, b) => (a.depth - b.depth) || localeCompare(a.name, b.name)) const res = new Set() const gArb = new Arborist({ global: true, path: resolve(npm.globalDir, '..'), workspacesEnabled, }) const gTree = await gArb.loadActual({ global: true }) for (const node of getValues(gTree)) { res.add(global ? node.name : [node.name, '-g']) } if (!global) { const arb = new Arborist({ global: false, path: prefix, workspacesEnabled }) const tree = await arb.loadActual() for (const node of getValues(tree)) { res.add(node.name) } } return [...res] } module.exports = installedDeep