{"version":3,"sources":["jsdelivr-header.js","/npm/@lerna/github-client@6.4.1/lib/github-client.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,MAAM,IAAM,QAAQ,UACd,aAAe,QAAQ,yBACvB,QAAE,SAAY,QAAQ,iBACtB,YAAc,QAAQ,iBAK5B,SAAS,qBACP,IAAI,MAAM,sBAEV,MAAM,SAAE,EAAQ,YAAE,EAAW,YAAE,GAAgB,QAAQ,IAEvD,IAAK,EACH,MAAM,IAAI,MAAM,gDAGd,GAEF,QAAQ,OAAO,QAAQ,uCAAuC,MAGhE,MAAM,EAAU,CACd,KAAM,SAAS,KAOjB,OAJI,IACF,EAAQ,QAAU,GAGb,IAAI,QAAQ,EACrB,CAEA,SAAS,aAAa,EAAS,SAAU,GACvC,IAAI,MAAM,gBAEV,MAAM,EAAO,CAAC,SAAU,QAAS,UAAU,SAE3C,IAAI,QAAQ,MAAO,GAEnB,MAAM,EAAM,aAAa,SAAS,MAAO,EAAM,GAE/C,IAAK,EACH,MAAM,IAAI,MAAM,4CAA4C,OAG9D,OAAO,YAAY,EACrB,CA1CA,QAAQ,mBAAqB,mBAC7B,QAAQ,aAAe","file":"/npm/@lerna/github-client@6.4.1/lib/github-client.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@lerna/github-client@6.4.1/lib/github-client.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\n\nconst log = require(\"npmlog\");\nconst childProcess = require(\"@lerna/child-process\");\nconst { Octokit } = require(\"@octokit/rest\");\nconst parseGitUrl = require(\"git-url-parse\");\n\nexports.createGitHubClient = createGitHubClient;\nexports.parseGitRepo = parseGitRepo;\n\nfunction createGitHubClient() {\n  log.silly(\"createGitHubClient\");\n\n  const { GH_TOKEN, GHE_API_URL, GHE_VERSION } = process.env;\n\n  if (!GH_TOKEN) {\n    throw new Error(\"A GH_TOKEN environment variable is required.\");\n  }\n\n  if (GHE_VERSION) {\n    // eslint-disable-next-line\n    Octokit.plugin(require(`@octokit/plugin-enterprise-rest/ghe-${GHE_VERSION}`));\n  }\n\n  const options = {\n    auth: `token ${GH_TOKEN}`,\n  };\n\n  if (GHE_API_URL) {\n    options.baseUrl = GHE_API_URL;\n  }\n\n  return new Octokit(options);\n}\n\nfunction parseGitRepo(remote = \"origin\", opts) {\n  log.silly(\"parseGitRepo\");\n\n  const args = [\"config\", \"--get\", `remote.${remote}.url`];\n\n  log.verbose(\"git\", args);\n\n  const url = childProcess.execSync(\"git\", args, opts);\n\n  if (!url) {\n    throw new Error(`Git remote URL could not be found using \"${remote}\".`);\n  }\n\n  return parseGitUrl(url);\n}\n"]}