confectus
Version:
2 lines (1 loc) • 592 B
JavaScript
import{a as n,b as o,c as a}from"./chunk-H2T5CARS.js";import{a as i}from"./chunk-6JCXTPW2.js";import t from"inquirer";var c=class{_answers={};stackChoice="";get answers(){return this._answers}wichStackWillUse(s){this.stackChoice=s.stack}saveAnswers(s){this._answers={...this._answers,...s}}async collectAnswers(s){try{let r=await t.prompt(n);if(this.wichStackWillUse(r),this.saveAnswers(r),this.stackChoice==="Backend"){let e=await t.prompt(o);this.saveAnswers(e)}else{let e=await t.prompt(a);this.saveAnswers(e)}return this._answers}catch{throw new Error(new i().message)}}};export{c as a};