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KA,OAAO,QAAU,CACf,cACA,oBACA,gBACA,0BACA,cACA","file":"/npm/robbyrussell@0.1.4/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/robbyrussell@0.1.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 * Cross-shell robbyrussell theme written in JavaScript\n *\n * @author: Denys Dovhan, denysdovhan.com\n * @license: MIT\n * @link: https://github.com/denysdovhan/robbyrussell-node\n */\n\nconst path   = require('path');\nconst colors = require('./utils/colors');\nconst git    = require('./utils/git');\n\n/**\n * Paint arrow in success or failure colors depending on\n * status code of the last executed command\n * @param  {object} config Configuration of prompt\n * @return {string}        Propmpt character with color\n */\nfunction status(config) {\n  const { char, success, failure } = config.status;\n  return `${config.code === 0 ? success : failure}${char} `;\n}\n\n/**\n * Current working directory\n * @param  {object} config Configuration of prompt\n * @return {string}        Formated string with current folder\n */\nfunction directory(config) {\n  const { color } = config.dir;\n  const dir = path.basename(config.cwd);\n  return `${color}${dir === process.env.USER ? '~' : dir}`;\n}\n\n/**\n * Synchronous method\n * Get current branch and check if repo is dirty\n * @param  {object} config Configuration of prompt\n * @return {string}        Fromated string with git status\n */\nfunction gitRepo(config) {\n  const { indicator, branch, dirty, dirtyChar } = config.git;\n\n  let gitStatus = '';\n\n  if (git.isGitSync(config.cwd)) {\n    gitStatus += ` ${indicator}git:(${branch}${git.branchSync()}${indicator})`;\n\n    if (git.dirtySync(config.cwd) || git.untrackedSync(config.cwd)) {\n      gitStatus += `${dirty} ${dirtyChar}`;\n    }\n  }\n\n  return gitStatus;\n}\n\n/**\n * Asynchronous method\n * Get current branch and check if repo is dirty\n * @param {object} config Configuration of prompt\n * @return {string}       Formated string with git status\n */\nasync function gitRepoAsync(config) {\n  const { indicator, branch, dirty, dirtyChar } = config.git;\n\n  let gitStatus = '';\n\n  if (await git.isGit(config.cwd)) {\n    gitStatus += ` ${indicator}git:(${branch}${await git.branch()}${indicator})`;\n\n    if (await git.dirty(config.cwd) || await git.untracked(config.cwd)) {\n      gitStatus += `${dirty} ${dirtyChar}`;\n    }\n  }\n\n  return gitStatus;\n}\n\n/**\n * Compose whole prompt\n * @param {object} config Configuration of prompt\n * @return {string}\n */\nfunction prompt(config) {\n  const { open, close } = config.prompt;\n  return `${open}${status(config)}${directory(config)}${gitRepo(config)}${close} `;\n}\n\n/**\n * Compose whole prompt\n * @param {object} config Configuration of prompt\n * @return {string}\n */\nasync function promptAsync(config) {\n  const { open, close } = config.prompt;\n  return `${open}${status(config)}${directory(config)}${await gitRepo(config)}${close} `;\n}\n\n/**\n * Export all parts for prompt\n */\nmodule.exports = {\n  status,\n  directory,\n  gitRepo,\n  gitRepoAsync,\n  prompt,\n  promptAsync,\n};\n"]}