{"version":3,"sources":["jsdelivr-header.js","/npm/npm-configuration-switcher@0.2.3/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;ACJA,MAAM,SAAW,QAAQ,aACnB,QAAU,QAAQ,aAClB,OAAS,QAAQ,UAAU,OAC3B,IAAM,QAAQ,UAAU,IACxB,cAAgB,QAAQ,mBA6B9B,SAAS,uBAAwB,GAM7B,MAAO,CAAC,KAAe,KACnB,IAAI,GAAK,EACT,IAAI,IAAI,EAAI,EAAG,EAAI,EAAU,OAAQ,IAAI,CACrC,IAAI,GARU,EAQc,KARnB,EAQa,GAPR,OACP,KACJ,EAAK,GAML,OAAS,GAAS,iBAAqB,IACtC,GAAK,EACL,IAAI,MAAM,MAAM,OAAO,UAAU,EAAU,0BAEnD,CAbY,IAAC,EAAK,EAcb,GACD,QAAQ,KAAK,EACjB,CAER,CA7CA,QACG,QAAQ,SAGX,QACK,QAAQ,gBAAgB,qEAI7B,QACK,QAAQ,oBAAoB,2CAGjC,QACK,QAAQ,uBAAuB,sDAGpC,QACK,QAAQ,aAAa,mDAG1B,QACK,QAAQ,UAAU,kCAwBvB,QAAQ,MAAM,QAAQ","file":"/npm/npm-configuration-switcher@0.2.3/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/npm-configuration-switcher@0.2.3/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","#!/usr/bin/env node\n\nconst userHome = require('user-home');\nconst program = require('commander');\nconst colors = require(\"./logs\").colors;\nconst log = require(\"./logs\").log;\nconst configManager = require('./configManager');\n\n\nprogram\n  .version('0.2.3');\n\n// index-switch.js\nprogram\n    .command(\"switch [name]\",\"switch NPM configuration to the configuration with the given name\");\n\n\n// index-current.js\nprogram\n    .command(\"current [options]\",'show the current NPM configuration name');\n\n// index-new.js\nprogram\n    .command(\"new [name] [options]\",'create a new confuguration with the sepcified name');\n\n// index-get.js\nprogram\n    .command(\"get [name]\",'show the content of the specified configuration');\n\n// index-configs.js\nprogram\n    .command(\"configs\",'show all stored configurations');\n\n\n// Check if the given args are present\nfunction checkMandatoryArgFn (...argsNames) {\n    let getOrNull = (list,index) => {\n        if( index >= list.length)\n            return null;\n        return list[index];\n    }\n    return (commandStr, ...args) => {\n        let ok = true;\n        for(let i = 0; i < argsNames.length; i++){\n            let param = getOrNull(args, i);\n            if(null === param || typeof \"\" !== typeof param){\n                ok = false;\n                log.error(`No ${colors.errorInfo(argsNames[i])} parameter given.\\n`);\n            }\n        }\n        if(! ok){\n            process.exit(1);\n        }\n    };\n};\nprogram.parse(process.argv);\n\n\n\n"]}