{"version":3,"names":["getNpmVersionIfAvailable","npmVersion","execSync","stdio","toString","trim","error","isProjectUsingNpm","cwd","findUp","sync"],"sources":["../../src/tools/npm.ts"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport {execSync} from 'child_process';\nimport findUp from 'find-up';\n\nexport function getNpmVersionIfAvailable() {\n let npmVersion;\n try {\n // execSync returns a Buffer -> convert to string\n npmVersion = (\n execSync('npm --version', {\n stdio: [0, 'pipe', 'ignore'],\n }).toString() || ''\n ).trim();\n\n return npmVersion;\n } catch (error) {\n return null;\n }\n}\n\nexport function isProjectUsingNpm(cwd: string) {\n return findUp.sync('package-lock.json', {cwd});\n}\n"],"mappings":";;;;;;;AAQA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA6B;AAT7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAKO,SAASA,wBAAwB,GAAG;EACzC,IAAIC,UAAU;EACd,IAAI;IACF;IACAA,UAAU,GAAG,CACX,IAAAC,yBAAQ,EAAC,eAAe,EAAE;MACxBC,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ;IAC7B,CAAC,CAAC,CAACC,QAAQ,EAAE,IAAI,EAAE,EACnBC,IAAI,EAAE;IAER,OAAOJ,UAAU;EACnB,CAAC,CAAC,OAAOK,KAAK,EAAE;IACd,OAAO,IAAI;EACb;AACF;AAEO,SAASC,iBAAiB,CAACC,GAAW,EAAE;EAC7C,OAAOC,iBAAM,CAACC,IAAI,CAAC,mBAAmB,EAAE;IAACF;EAAG,CAAC,CAAC;AAChD"}