Socket
Socket
Sign inDemoInstall

@whatwg-node/events

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@whatwg-node/events - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1-alpha-20230525101758-552afdd

8

CHANGELOG.md
# @whatwg-node/events
## 0.1.1-alpha-20230525101758-552afdd
### Patch Changes
- [#554](https://github.com/ardatan/whatwg-node/pull/554)
[`552afdd`](https://github.com/ardatan/whatwg-node/commit/552afdd156de29d1f0bb3f2d172e3189c4dd7c6f)
Thanks [@n1ru4l](https://github.com/n1ru4l)! - Follow the spec and set `detail` to null by default
## 0.1.0

@@ -4,0 +12,0 @@

2

dist/node-ponyfill.js

@@ -6,5 +6,5 @@ module.exports.CustomEvent = globalThis.CustomEvent;

super(type, options);
this.detail = options && options.detail;
this.detail = options?.detail ?? null;
}
}
}
{
"name": "@whatwg-node/events",
"version": "0.1.0",
"version": "0.1.1-alpha-20230525101758-552afdd",
"description": "Cross Platform Smart Event API Ponyfill",

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

import { CustomEvent } from '@whatwg-node/events';
describe('CustomEvent', () => {
it('detail', () => {
it('detail should be set', () => {
const target = new EventTarget();

@@ -11,2 +11,9 @@ const listener = jest.fn();

});
it('detail should be null by default', () => {
const target = new EventTarget();
const listener = jest.fn();
target.addEventListener('test', listener);
target.dispatchEvent(new CustomEvent('test'));
expect(listener).toHaveBeenCalledWith(expect.objectContaining({ detail: null }));
})
});
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