{"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,iBAAAA,GAAoB,IAAA;;AAExB,IAAA,MAAMC,KAAAA,GAAQC,OAAAA,CAAQC,GAAG,CAACC,qBAAqB,IAAI,EAAA;IAEnD,IAAIH,KAAAA,CAAMI,QAAQ,CAAC,MAAA,CAAA,EAAS;QAC1B,OAAO,MAAA;AACT,IAAA;IAEA,IAAIJ,KAAAA,CAAMI,QAAQ,CAAC,MAAA,CAAA,EAAS;QAC1B,OAAO,MAAA;AACT,IAAA;;;;IAKA,IAAI,UAAA,CAAWC,IAAI,CAACL,KAAAA,CAAAA,EAAQ;QAC1B,OAAO,KAAA;AACT,IAAA;IAEA,OAAOM,SAAAA;AACT;;;;"}