{"version":3,"file":"managers.mjs","sources":["../../../../src/node/core/managers.ts"],"sourcesContent":["/**\n * @description Supports the following managers:\n * – npm\n * – yarn\n * – pnpm\n */\nconst getPackageManager = () => {\n // Yes, the env var is lowercase - it is set by the package managers themselves\n const agent = process.env.npm_config_user_agent || '';\n\n if (agent.includes('yarn')) {\n return 'yarn';\n }\n\n if (agent.includes('pnpm')) {\n return 'pnpm';\n }\n\n // Both yarn and pnpm does a `npm/?` thing, thus the slightly different match here\n // Theoretically not needed since we check for yarn/pnpm above, but in case other\n // package managers do the same thing, we'll (hopefully) catch them here.\n if (/^npm\\/\\d/.test(agent)) {\n return 'npm';\n }\n\n return undefined;\n};\n\nexport { getPackageManager };\n"],"names":["getPackageManager","agent","process","env","npm_config_user_agent","includes","test","undefined"],"mappings":"AAAA;;;;;AAKC,UACKA,iBAAoB,GAAA,IAAA;;AAExB,IAAA,MAAMC,KAAQC,GAAAA,OAAAA,CAAQC,GAAG,CAACC,qBAAqB,IAAI,EAAA;IAEnD,IAAIH,KAAAA,CAAMI,QAAQ,CAAC,MAAS,CAAA,EAAA;QAC1B,OAAO,MAAA;AACT;IAEA,IAAIJ,KAAAA,CAAMI,QAAQ,CAAC,MAAS,CAAA,EAAA;QAC1B,OAAO,MAAA;AACT;;;;IAKA,IAAI,UAAA,CAAWC,IAAI,CAACL,KAAQ,CAAA,EAAA;QAC1B,OAAO,KAAA;AACT;IAEA,OAAOM,SAAAA;AACT;;;;"}