Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
stdin.on('data', (key: string) => {
if (key === KEYS.ENTER) {
resolve();
} else if (
[KEYS.ESCAPE, KEYS.CONTROL_C, KEYS.CONTROL_D].indexOf(key) !== -1
) {
reject();
}
});
} else {