Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (key === 'CTRL_C') {
terminate('cancelled');
}
if (qReady) {
if (key === 'CTRL_Q') {
// exit = true;
qs = ib.getInput();
ib.abort();
terminate();
}
if ((key === 'ENTER' || key === 'KP_ENTER') && !menuOn) {
qs = ib.getInput();
try {
const errors = await validateQuery(parse(qs), schema);
if (errors.length === 0) {
ib.abort();
terminate();
}
} catch (err) {
ib.abort();
term.eraseLine();
term.left(qs.length + 5);
inputLine(qs);
}
}
if (key === 'TAB' && !menuOn) {
qs = ib.getInput();
let bStack = [];
for (let c of qs) {