Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function Prompt() {
Base.apply(this, arguments);
if (!this.opt.source) {
this.throwParamError('source');
}
this.currentChoices = [];
this.firstRender = true;
this.selected = 0;
// Make sure no default is set (so it won't be printed)
this.opt.default = null;
this.paginator = new Paginator();
}
util.inherits(Prompt, Base);
function Prompt() {
Base.apply(this, arguments);
// Set Defaults
this.opt = _.cloneDeep(this.opt);
_.defaultsDeep(this.opt, {
date: {
max: null,
min: null
},
time: {
max: null,
min: null,
hours: {
interval: 1
},
minutes: {
interval: 1
function Prompt() {
Base.apply( this, arguments );
if (!this.opt.basePath) {
this.throwParamError("basePath");
}
this.depth = 0;
this.currentPath = path.isAbsolute(this.opt.basePath) ? path.resolve(this.opt.basePath) : path.resolve(process.cwd(), this.opt.basePath);
this.opt.choices = new Choices(this.createChoices(this.currentPath), this.answers);
this.selected = 0;
this.firstRender = true;
// Make sure no default is set (so it won't be printed)
this.opt.default = null;
this.searchTerm = '';
function Prompt() {
Base.apply( this, arguments );
if (!this.opt.choices) {
this.throwParamError("choices");
}
if ( _.isArray(this.opt.default) ) {
this.opt.choices.forEach(function( choice ) {
if ( this.opt.default.indexOf(choice.value) >= 0 ) {
choice.checked = true;
}
}, this);
}
this.firstRender = true;
this.pointer = 0;