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

react-hotkeys-hook

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hotkeys-hook - npm Package Compare versions

Comparing version 4.0.0-5 to 4.0.0-6

dist/isHotkeyPressed.d.ts

3

dist/index.d.ts
import useHotkeys from './useHotkeys';
import type { Options } from './types';
import { HotkeysProvider, useHotkeysContext } from './HotkeysProvider';
export { useHotkeys, useHotkeysContext, HotkeysProvider, Options, };
import { isHotkeyPressed } from './isHotkeyPressed';
export { useHotkeys, useHotkeysContext, isHotkeyPressed, HotkeysProvider, Options, };
{
"name": "react-hotkeys-hook",
"version": "4.0.0-5",
"version": "4.0.0-6",
"repository": "https://JohannesKlauss@github.com/JohannesKlauss/react-keymap-hook.git",

@@ -5,0 +5,0 @@ "homepage": "https://johannesklauss.github.io/react-hotkeys-hook/",

@@ -5,2 +5,11 @@ import { Hotkey, KeyboardModifiers, Keys } from './types'

const mappedKeys: Record<string, string> = {
esc: 'escape',
return: 'enter',
left: 'arrowleft',
up: 'arrowup',
right: 'arrowright',
down: 'arrowdown',
}
export function parseKeysHookInput(keys: Keys, splitKey: string = ','): string[] {

@@ -19,4 +28,3 @@ if (typeof keys === 'string') {

.map(k => k.trim())
.map(k => k === 'esc' ? 'escape' : k)
.map(k => k === 'return' ? 'enter' : k)
.map(k => mappedKeys[k] || k)

@@ -23,0 +31,0 @@ const modifiers: KeyboardModifiers = {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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