Socket
Socket
Sign inDemoInstall

@github/hotkey

Package Overview
Dependencies
Maintainers
19
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@github/hotkey - npm Package Compare versions

Comparing version 1.5.5 to 1.6.0

11

dist/index.js

@@ -84,3 +84,7 @@ class Leaf {

}
function fireDeterminedAction(el) {
function fireDeterminedAction(el, path) {
const delegateEvent = new CustomEvent('hotkey-fire', { cancelable: true, detail: { path } });
const cancelled = !el.dispatchEvent(delegateEvent);
if (cancelled)
return;
if (isFormField(el)) {

@@ -106,3 +110,5 @@ el.focus();

let resetTriePositionTimer = null;
let path = [];
function resetTriePosition() {
path = [];
resetTriePositionTimer = null;

@@ -132,2 +138,3 @@ currentTriePosition = hotkeyRadixTrie;

}
path.push(hotkey(event));
currentTriePosition = newTriePosition;

@@ -148,3 +155,3 @@ if (newTriePosition instanceof Leaf) {

if (elementToFire && shouldFire) {
fireDeterminedAction(elementToFire);
fireDeterminedAction(elementToFire, path);
event.preventDefault();

@@ -151,0 +158,0 @@ }

2

dist/utils.d.ts
export declare function isFormField(element: Node): boolean;
export declare function fireDeterminedAction(el: HTMLElement): void;
export declare function fireDeterminedAction(el: HTMLElement, path: string[]): void;
export declare function expandHotkeyToEdges(hotkey: string): string[][];

@@ -12,3 +12,7 @@ export function isFormField(element) {

}
export function fireDeterminedAction(el) {
export function fireDeterminedAction(el, path) {
const delegateEvent = new CustomEvent('hotkey-fire', { cancelable: true, detail: { path } });
const cancelled = !el.dispatchEvent(delegateEvent);
if (cancelled)
return;
if (isFormField(el)) {

@@ -15,0 +19,0 @@ el.focus();

{
"name": "@github/hotkey",
"version": "1.5.5",
"version": "1.6.0",
"description": "",

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

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