UNPKG

1 kBJavaScriptView Raw
1Object.defineProperty(exports,"__esModule",{value:!0});const e=require("tslib"),a=require("inquirer");exports.promptScopedPackage=function promptScopedPackage(c){return e.__awaiter(this,void 0,void 0,function*(){if(0===c.packages.length)throw new Error("No package is available.");return c.multi?yield function readMultipleScopes(c){return e.__awaiter(this,void 0,void 0,function*(){const{packages:e,checked:t}=c,{scopes:o}=yield a.prompt({type:"checkbox",name:"scopes",message:"Select packages",pageSize:1e3,choices:e.map(e=>({name:e.packageName,value:e,checked:!!t&&t(e)})),validate:e=>!(e.length<1)||"You must choose at lease one package!"});return o})}(c):yield function readSingleScope(c){return e.__awaiter(this,void 0,void 0,function*(){const{packages:e,checked:t}=c,{scope:o}=yield a.prompt({type:"list",name:"scope",message:"Select one package",pageSize:1e3,choices:e.map(e=>({name:e.packageName,value:e,checked:!!t&&t(e)}))});return o})}(c)})};
2//# sourceMappingURL=prompt-scoped-package.js.map
\No newline at end of file