react-hotkeys-hook
Advanced tools
Comparing version 4.0.4-1 to 4.0.4-2
@@ -0,0 +0,0 @@ import { ReactNode } from 'react'; |
@@ -0,0 +0,0 @@ import { Hotkey } from './types'; |
@@ -0,0 +0,0 @@ import useHotkeys from './useHotkeys'; |
export declare function isHotkeyPressed(key: string | string[], splitKey?: string): boolean; | ||
export declare function pushToCurrentlyPressedKeys(key: string | string[]): void; | ||
export declare function removeFromCurrentlyPressedKeys(key: string | string[]): void; |
import { Hotkey, Keys } from './types'; | ||
export declare function parseKeysHookInput(keys: Keys, splitKey?: string): string[]; | ||
export declare function parseHotkey(hotkey: string, combinationKey?: string): Hotkey; |
@@ -0,0 +0,0 @@ import type { DependencyList } from 'react'; |
export default function useDeepEqualMemo<T>(value: T): T | undefined; |
@@ -0,2 +1,3 @@ | ||
/// <reference types="react" /> | ||
import { HotkeyCallback, Keys, OptionsOrDependencyArray, RefType } from './types'; | ||
export default function useHotkeys<T extends HTMLElement>(keys: Keys, callback: HotkeyCallback, options?: OptionsOrDependencyArray, dependencies?: OptionsOrDependencyArray): import("react").MutableRefObject<RefType<T>>; |
@@ -0,0 +0,0 @@ import { FormTags, Hotkey, Scopes, Trigger } from './types'; |
{ | ||
"name": "react-hotkeys-hook", | ||
"version": "4.0.4-1", | ||
"version": "4.0.4-2", | ||
"repository": "https://JohannesKlauss@github.com/JohannesKlauss/react-keymap-hook.git", | ||
"homepage": "https://johannesklauss.github.io/react-hotkeys-hook/", | ||
"author": "Johannes Klauss", | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.mjs", | ||
"main": "dist/index.js", | ||
"module": "dist/react-hotkeys-hook.esm.js", | ||
"types": "dist/index.d.ts", | ||
@@ -28,3 +28,3 @@ "files": [ | ||
"scripts": { | ||
"build": "node ./esbuild.js && tsc --project tsconfig.build.json", | ||
"build": "tsdx build", | ||
"test": "jest", | ||
@@ -61,3 +61,2 @@ "publish": "np" | ||
"@types/react-dom": "18.0.6", | ||
"esbuild": "0.15.13", | ||
"eslint-plugin-prettier": "4.2.1", | ||
@@ -70,2 +69,3 @@ "jest": "29.2.2", | ||
"react-test-renderer": "18.2.0", | ||
"tsdx": "0.14.1", | ||
"tslib": "2.4.0", | ||
@@ -72,0 +72,0 @@ "typescript": "4.7.4" |
@@ -1,3 +0,3 @@ | ||
import { HotkeyCallback, Keys, OptionsOrDependencyArray, RefType } from './types' | ||
import { useCallback, useEffect, useLayoutEffect, useRef } from 'react' | ||
import { HotkeyCallback, Keys, Options, OptionsOrDependencyArray, RefType } from './types' | ||
import { DependencyList, useCallback, useEffect, useLayoutEffect, useRef } from 'react' | ||
import { parseHotkey, parseKeysHookInput } from './parseHotkeys' | ||
@@ -33,4 +33,4 @@ import { | ||
const _options = !(options instanceof Array) ? options : !(dependencies instanceof Array) ? dependencies : undefined | ||
const _deps = options instanceof Array ? options : dependencies instanceof Array ? dependencies : [] | ||
const _options: Options | undefined = !(options instanceof Array) ? (options as Options) : !(dependencies instanceof Array) ? (dependencies as Options) : undefined | ||
const _deps: DependencyList = options instanceof Array ? options : dependencies instanceof Array ? dependencies : [] | ||
@@ -37,0 +37,0 @@ const cb = useCallback(callback, [..._deps]) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
155886
30
1328
2
2
1