Socket
Socket
Sign inDemoInstall

is-hotkey

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-hotkey - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

12

lib/index.js

@@ -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]

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc