UNPKG

716 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.createOnFallback = void 0;
4const color_1 = require("./color");
5function createOnFallback({ flags: { confirm }, log }) {
6 return (question) => {
7 if (question.type === 'confirm') {
8 if (confirm) {
9 log.msg(`${color_1.input('--confirm')}: ${color_1.weak(question.message)} ${color_1.ancillary('Yes')}`);
10 return true;
11 }
12 else {
13 log.msg(`${color_1.input('--no-confirm')}: ${color_1.weak(question.message)} ${color_1.ancillary('No')}`);
14 return false;
15 }
16 }
17 };
18}
19exports.createOnFallback = createOnFallback;