Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Prompt.prototype._run = function (cb) {
this.done = cb;
this.editorResult = new rx.Subject();
// Open Editor on "line" (Enter Key)
var events = observe(this.rl);
this.lineSubscription = events.line.forEach(this.startExternalEditor.bind(this));
// Trigger Validation when editor closes
var validation = this.handleSubmitEvents(this.editorResult);
validation.success.forEach(this.onEnd.bind(this));
validation.error.forEach(this.onError.bind(this));
// Prevents default from being printed on screen (can look weird with multiple lines)
this.currentText = this.opt.default;
this.opt.default = null;
// Init
this.render();