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

quantifai-editorjs-shortcuts

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quantifai-editorjs-shortcuts - npm Package Compare versions

Comparing version 1.1.1-mp.2.0.1 to 1.1.1-mp.2.1.0

2

package.json
{
"name": "quantifai-editorjs-shortcuts",
"version": "1.1.1-mp.2.0.1",
"version": "1.1.1-mp.2.1.0",
"description": "Library for handling keyboard shortcuts",

@@ -5,0 +5,0 @@ "main": "./dist/shortcuts.js",

@@ -49,2 +49,4 @@ const keycode = require('keycode');

this.name = shortcut.name;
this.previousEnteredKey = null;
this.sequenceStartKey = null;

@@ -67,2 +69,7 @@ this.parseShortcutName(shortcut.name);

parseShortcutName(shortcut) {
const sequentialShortcuts = shortcut.split(',');
if (sequentialShortcuts.length === 2) {
this.sequenceStartKey = sequentialShortcuts[0];
shortcut = sequentialShortcuts[1];
}
shortcut = shortcut.split('+');

@@ -117,3 +124,4 @@ for (let key = 0; key < shortcut.length; key++) {

let key,
allKeysPassed = true;
allKeysPassed = true,
sequenceStartKeyPressed = true;

@@ -124,3 +132,11 @@ for (key in this.keys) {

if (allCommandsPassed && allKeysPassed) {
if (
this.sequenceStartKey &&
keycode(this.sequenceStartKey) !== this.previousEnteredKey
) {
sequenceStartKeyPressed = false;
}
this.previousEnteredKey = event.keyCode;
if (allCommandsPassed && allKeysPassed && sequenceStartKeyPressed) {
this.callback(event);

@@ -127,0 +143,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