Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-keybindings

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-keybindings - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

18

lib/components/mapActionsToKeys.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

@@ -7,6 +11,2 @@

Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = require("react");

@@ -18,4 +18,2 @@

var _lodash = require("lodash");
var _keyActions = require("../utils/keyActions");

@@ -97,15 +95,15 @@

// remove special keys
if (ctrl > -1) {
if (!e.ctrlKey && ctrl > -1) {
pressedKeys.splice(ctrl, 1);
}
if (meta > -1) {
if (!e.metaKey && meta > -1) {
pressedKeys.splice(meta, 1);
}
if (shift > -1) {
if (!e.shiftKey && shift > -1) {
pressedKeys.splice(shift, 1);
}
if (alt > -1) {
if (!e.altKey && alt > -1) {
pressedKeys.splice(alt, 1);

@@ -112,0 +110,0 @@ }

"use strict";
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _keyCodes = require("./keyCodes");

@@ -11,0 +11,0 @@

{
"name": "react-keybindings",
"version": "1.0.8",
"version": "1.0.9",
"description": "Add keybindings in React apps",

@@ -27,89 +27,29 @@ "main": "./lib/index.js",

"devDependencies": {
"babel-core": "^6.4.5",
"babel-eslint": "^5.0.0-beta6",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-1": "^6.3.13",
"eslint": "^1.10.3",
"eslint-plugin-react": "^3.16.1",
"lodash": "^4.3.0",
"react": "^0.14.7",
"react-dom": "^0.14.7",
"rimraf": "^2.5.1"
"babel-core": "^6.7.5",
"babel-eslint": "^6.0.2",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-1": "^6.5.0",
"eslint": "^2.7.0",
"eslint-config-general": "^1.0.1",
"eslint-plugin-react": "^4.3.0",
"react": "^15.0.0",
"react-dom": "^15.0.0",
"rimraf": "^2.5.2"
},
"peerDependencies": {
"react": "^0.14.0",
"react-dom": "^0.14.0"
"react": "^15.0.0",
"react-dom": "^15.0.0"
},
"babel": {
"presets": [
"es2015",
"stage-1",
"react"
]
},
"eslintConfig": {
"extends": "eslint:recommended",
"parser": "babel-eslint",
"ecmaFeatures": {
"modules": true,
"jsx": true
},
"env": {
"es6": true,
"browser": true,
"node": true
},
"plugins": [
"react"
],
"rules": {
"indent": [
2,
2
],
"max-len": [
2,
80,
4
],
"eqeqeq": [
2,
"allow-null"
],
"semi": [
2,
"never"
],
"comma-dangle": [
1,
"always-multiline"
],
"no-console": 0,
"no-else-return": 2,
"arrow-parens": 2,
"arrow-spacing": [
2,
{
"after": true,
"before": true
}
],
"no-var": 2,
"prefer-const": 2,
"jsx-quotes": [
2,
"prefer-double"
],
"react/jsx-closing-bracket-location": [
2,
"after-props"
],
"react/jsx-indent-props": [
2,
2
],
"react/jsx-indent": [
2,
2
],
"react/jsx-uses-react": 2,
"react/react-in-jsx-scope": 2,
"react/no-multi-comp": 2,
"react/prefer-es6-class": 2
}
"extends": "eslint-config-general/react",
"parser": "babel-eslint"
}
}
import React, { Component } from "react"
import { findDOMNode } from "react-dom"
import { isEqual } from "lodash"
import keyActions from "../utils/keyActions"

@@ -79,15 +78,15 @@ import * as specialKeys from "../utils/keyCodes"

// remove special keys
if (ctrl > -1) {
if (!e.ctrlKey && ctrl > -1) {
pressedKeys.splice(ctrl, 1)
}
if (meta > -1) {
if (!e.metaKey && meta > -1) {
pressedKeys.splice(meta, 1)
}
if (shift > -1) {
if (!e.shiftKey && shift > -1) {
pressedKeys.splice(shift, 1)
}
if (alt > -1) {
if (!e.altKey && alt > -1) {
pressedKeys.splice(alt, 1)

@@ -94,0 +93,0 @@ }

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