{"version":3,"sources":["jsdelivr-header.js","/npm/detect-installed@2.0.4/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACCA,aAEA,MAAM,IAAM,QAAQ,sBAkDpB,OAAO,QAAU,SAA0B,EAAM,GAC/C,OAAO,IAAI,SAAQ,CAAC,EAAS,KAC3B,IAAI,EAAM,GAAM,MAAK,IAAM,GAAQ,KAAO,IAAM,GAAQ,IAAM,GAElE,EAsBA,OAAO,QAAQ,KAAO,SAA8B,EAAM,GACxD,IAAI,EAAS,KACb,IACE,EAAS,IAAI,KAAK,EAAM,EAC1B,CAAE,MAAO,GACP,OAAO,CACT,CAEA,MAAyB,iBAAX,CAChB","file":"/npm/detect-installed@2.0.4/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/detect-installed@2.0.4/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*!\n * detect-installed <https://github.com/tunnckoCore/detect-installed>\n *\n * Copyright (c) Charlike Mike Reagent <@tunnckoCore> (http://i.am.charlike.online)\n * Released under the MIT license.\n */\n\n'use strict'\n\nconst get = require('get-installed-path')\n\n/**\n * > Detect if some package `name`is\n * installed globally or locally. By default checks\n * if it exists in globally installed modules, using [global-modules][].\n * Pass `opts.local` to check if it exists in locally installed modules\n * or in `opts.cwd` dir.\n *\n * **Example**\n *\n * ```js\n * const detectInstalled = require('detect-installed')\n *\n * detectInstalled('npm').then((exists) => {\n *   console.log(exists) // => true\n * })\n *\n * detectInstalled('foo-bar-barwerwlekrjw').then((exists) => {\n *   console.log(exists) // => false\n * })\n *\n * detectInstalled('npm', {\n *   local: true\n * }).then((exists) => {\n *   console.log(exists) // => false\n * })\n *\n * detectInstalled('global-modules', {\n *   local: true\n * }).then((exists) => {\n *   console.log(exists) // => true\n * })\n *\n * // If you are using it for some sub-directory\n * // pass `opts.cwd` to be where the `node_modules`\n * // folder is.\n * process.chidr('foo-bar-baz')\n * detectInstalled('global-modules', {\n *   local: true,\n *   cwd: '../'\n * }).then((exists) => console.log(exists)) // => true\n * ```\n *\n * @param  {String} `name` package name\n * @param  {Object} `opts` pass `opts.local` to check locally\n * @return {Promise} always resolved promise, never rejected\n * @api public\n */\n\nmodule.exports = function detectInstalled (name, opts) {\n  return new Promise((resolve, reject) => {\n    get(name, opts).then(() => resolve(true), () => resolve(false))\n  })\n}\n\n/**\n * > Synchronously check if package `name` exists\n * as locally or globally installed modules.\n *\n * **Example**\n *\n * ```js\n * const detectInstalled = require('detect-installed')\n *\n * const exists = detectInstalled.sync('npm') // => true\n * const result = detectInstalled.sync('global-modules', { local: true }) // => true\n * ```\n *\n * @name   .sync\n * @param  {String} `name` package name\n * @param  {Object} `opts` pass `opts.local` to check locally\n * @return {Boolean} false, if error or not exists globally/locally\n * @api public\n */\n\nmodule.exports.sync = function detectInstalledSync (name, opts) {\n  let result = null\n  try {\n    result = get.sync(name, opts)\n  } catch (e) {\n    return false\n  }\n\n  return typeof result === 'string'\n}\n"]}