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

add-promise-listener

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

add-promise-listener - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

16

index.js

@@ -0,1 +1,2 @@

const { defineProperty } = Object;
const { get } = Reflect;

@@ -9,2 +10,4 @@

const once = { once: true };
// avoid event.preventDefault throwing due illegal Proxy invocation

@@ -35,4 +38,9 @@ const bound = (e, value) => typeof value === 'function' ? value.bind(e) : value;

(resolve, reject) => {
if (options.signal)
options.signal.addEventListener('abort', reject);
const handler = new Handler(element);
if (options.signal) {
const abort = event => reject(new Proxy(event, handler));
options.signal.addEventListener('abort', abort, once);
if (options.signal.aborted)
return options.signal.dispatchEvent(new Event('abort'));
}
element.addEventListener(

@@ -44,7 +52,7 @@ type,

}
resolve(new Proxy(event, new Handler(element)));
resolve(new Proxy(event, handler));
},
{ ...options, once: true }
{ ...options, ...once }
);
}
);
{
"name": "add-promise-listener",
"version": "0.1.2",
"version": "0.1.3",
"main": "index.js",

@@ -5,0 +5,0 @@ "directories": {

@@ -34,2 +34,3 @@ # add-promise-listener

event => {
console.assert(event.currentTarget === button, 'currentTarget');
console.error(event.target.reason);

@@ -36,0 +37,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