diff options
author | Florrie <towerofnix@gmail.com> | 2018-05-30 23:55:12 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-05-30 23:55:12 -0300 |
commit | f782f7395cd287d4767c1f3ffd20a72a51007595 (patch) | |
tree | ffe4c62ca1c38a72121509baeb68d344fe999312 | |
parent | 581c8db27bc25c74b02a1b29d795c847118c6234 (diff) |
Add isCaselessLetter util function
-rw-r--r-- | util/telchars.js | 2 |
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 |