@reecelucas/react-use-hotkeys
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -8,4 +8,5 @@ export default (function (hotkeys) { | ||
if (hkeys.includes('+')) { | ||
// We're dealing with a modifier-key combination | ||
return hkeys.replace(/\s+/g, '').split('+'); | ||
// We're dealing with a modifier-key combination. The `/(?<!\+)\+/` regex | ||
// matches a single `+`, allowing combinations including `+`, E.g. `Shift++`. | ||
return hkeys.replace(/\s+/g, '').split(/(?<!\+)\+/); | ||
} | ||
@@ -12,0 +13,0 @@ /** |
@@ -10,4 +10,5 @@ "use strict"; | ||
if (hkeys.includes('+')) { | ||
// We're dealing with a modifier-key combination | ||
return hkeys.replace(/\s+/g, '').split('+'); | ||
// We're dealing with a modifier-key combination. The `/(?<!\+)\+/` regex | ||
// matches a single `+`, allowing combinations including `+`, E.g. `Shift++`. | ||
return hkeys.replace(/\s+/g, '').split(/(?<!\+)\+/); | ||
} | ||
@@ -14,0 +15,0 @@ /** |
{ | ||
"name": "@reecelucas/react-use-hotkeys", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "React hook to create keyboard shortcuts", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
22115
396