New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@accurat/event-utils

Package Overview
Dependencies
Maintainers
7
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@accurat/event-utils - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

9

index.js

@@ -46,3 +46,11 @@ function preventingDefault(fn) {

function attachListenersToKeys(keysListenersAssociation) {
return e => {
if (keysListenersAssociation.hasOwnProperty(e.key)) {
return keysListenersAssociation[e.key](e)
}
}
}
module.exports = {

@@ -55,2 +63,3 @@ preventingDefault,

replaceArguments,
attachListenersToKeys,
}

2

package.json
{
"name": "@accurat/event-utils",
"version": "1.0.1",
"version": "1.0.2",
"description": "High order functions to use in React's JSX when working with events",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -57,3 +57,3 @@ # @accurat/event-utils

/// ...
// ...

@@ -71,3 +71,2 @@ <div>

</div>
```

@@ -77,3 +76,19 @@

Another thing you can get rid of is the `onKeyDown` method with the switch case inside that fires a function on a certain `event.key`, you can use an object association instead:
```js
import { attachListenersToKeys } from '@accurat/event-utils'
// ...
<input
type="text"
onKeyDown={attachListenersToKeys({
Enter: preventingDefault(state.commit),
ArrowDown: state.selectNext,
ArrowUp: state.selectPrev,
})}
/>
```
## API

@@ -80,0 +95,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