« get me outta code hell

tui-lib - Pure Node.js library for making visual command-line programs (ala vim, ncdu)
about summary refs log tree commit diff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/telchars.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/telchars.js b/util/telchars.js
index 6908600..b39e17b 100644
--- a/util/telchars.js
+++ b/util/telchars.js
@@ -35,6 +35,8 @@ const telchars = {
   isShiftDown: buf => buf[0] === 0x1b && compareBufStr(buf.slice(1), '[1;2B'),
   isShiftRight: buf => buf[0] === 0x1b && compareBufStr(buf.slice(1), '[1;2C'),
   isShiftLeft: buf => buf[0] === 0x1b && compareBufStr(buf.slice(1), '[1;2D'),
+
+  isCaselessLetter: (buf, letter) => compareBufStr(buf, letter.toLowerCase()) || compareBufStr(buf, letter.toUpperCase()),
 }
 
 module.exports = telchars