#102·keymaster

unbind the comma

Author: cthurstonCreated Oct 4, 2013Updated May 30, 2017

It appears that the logic to catch the comma needs a little work. key.unbind(','); will kick an error about 188 toUpperCase(). I just decided to pop the extra element, but will break some unit tests I'm sure, like key.unbind('k,,,j');

Original: function getKeys(key) { var keys; key = key.replace(/\s/g, ''); keys = key.split(','); if ((keys[keys.length - 1]) == '') { keys[keys.length - 2] += ','; } return keys; }

Modified: function getKeys(key) { var keys; key = key.replace(/\s/g, ''); keys = key.split(','); if ((keys[keys.length - 1]) == '') { keys[keys.length - 2] += ','; keys.pop(); } return keys; }