Comparing version 0.1.3 to 0.1.4
@@ -155,3 +155,3 @@ 'use strict'; | ||
if (length == 1 || !modifier) { | ||
if (length === 1 || !modifier) { | ||
if (byKey) { | ||
@@ -167,8 +167,2 @@ ret.key = name; | ||
} | ||
// If there's only one key, and it's not a modifier, ignore the shift key | ||
// because it will already be taken into accout by the `event.key` value. | ||
if (length == 1 && !modifier && byKey) { | ||
ret.shiftKey = null; | ||
} | ||
} | ||
@@ -208,4 +202,4 @@ } catch (err) { | ||
actual = event.key.toLowerCase(); | ||
} else if (key == 'which') { | ||
actual = expected == 91 && event.which == 93 ? 91 : event.which; | ||
} else if (key === 'which') { | ||
actual = expected === 91 && event.which === 93 ? 91 : event.which; | ||
} else { | ||
@@ -212,0 +206,0 @@ actual = event[key]; |
{ | ||
"name": "is-hotkey", | ||
"description": "Check whether a browser event matches a hotkey.", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "repository": "git://github.com/ianstormtaylor/is-hotkey.git", |
# is-hotkey | ||
### `is-hotkey` | ||
A simple way to check whether a browser event matches a hotkey. | ||
--- | ||
<br/> | ||
@@ -16,3 +16,3 @@ ### Features | ||
--- | ||
<br/> | ||
@@ -49,3 +49,3 @@ ### Example | ||
--- | ||
<br/> | ||
@@ -62,3 +62,3 @@ ### Why? | ||
--- | ||
<br/> | ||
@@ -126,7 +126,1 @@ ### API | ||
You can also go even more low-level with the exposed `parseHotkey` and `compareHotkey` functions, which are what the default `isHotkey` export uses under the covers, in case you have more advanced needs. | ||
--- | ||
### License | ||
This package is [MIT-licensed](./License.md). |
@@ -139,3 +139,3 @@ | ||
if (length == 1 || !modifier) { | ||
if (length === 1 || !modifier) { | ||
if (byKey) { | ||
@@ -151,8 +151,2 @@ ret.key = name | ||
} | ||
// If there's only one key, and it's not a modifier, ignore the shift key | ||
// because it will already be taken into accout by the `event.key` value. | ||
if (length == 1 && !modifier && byKey) { | ||
ret.shiftKey = null | ||
} | ||
} | ||
@@ -178,4 +172,4 @@ | ||
actual = event.key.toLowerCase() | ||
} else if (key == 'which') { | ||
actual = expected == 91 && event.which == 93 ? 91 : event.which | ||
} else if (key === 'which') { | ||
actual = expected === 91 && event.which === 93 ? 91 : event.which | ||
} else { | ||
@@ -182,0 +176,0 @@ actual = event[key] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13772
389
123