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

can-dom-events

Package Overview
Dependencies
Maintainers
11
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-dom-events - npm Package Compare versions

Comparing version 1.3.11 to 1.3.12

dist/amd/can-dom-events.js

18

helpers/make-event-registry-test.js

@@ -69,1 +69,19 @@ var unit = require('steal-qunit');

});
unit.test('checks if custom event is already registered (#72)', function (assert) {
var eventType = 'boi';
var exampleEvent = {
defaultEventType: eventType,
addEventListener: function () {},
removeEventListener: function () {}
};
var registry = makeEventRegistry();
assert.equal(registry.has(eventType), false, 'initial registry should not have the event');
registry.add(exampleEvent, eventType);
assert.equal(registry.has(eventType), true, 'updated registry should have the event');
// In production, an Error is thrown
assert.equal(registry.add(exampleEvent, eventType), undefined, 'returns undefined if an event is already registered in development');
});
'use strict';
var dev = require('can-log/dev/dev');
function EventRegistry () {

@@ -90,2 +92,7 @@ this._registry = {};

if (this.has(eventType)) {
if (process.env.NODE_ENV !== 'production') {
dev.warn('Event "' + eventType + '" is already registered');
return;
}
throw new Error('Event "' + eventType + '" is already registered');

@@ -92,0 +99,0 @@ }

9

package.json
{
"name": "can-dom-events",
"description": "Listen for native and custom DOM events",
"version": "1.3.11",
"version": "1.3.12",
"author": {

@@ -16,2 +16,3 @@ "name": "Chris Andrejewski",

"can-key-tree": "^1.0.0",
"can-log": "^1.0.2",
"can-namespace": "^1.0.0",

@@ -22,2 +23,3 @@ "can-reflect": "^1.11.1"

"detect-cyclic-packages": "^1.1.0",
"done-serve": "^2.3.0",
"fixpack": "^2.3.1",

@@ -48,2 +50,3 @@ "jquery": "^3.2.1",

"detect-cycle": "detect-cyclic-packages --ignore done-serve",
"develop": "done-serve --static --develop --port 8080",
"jshint": "jshint ./*.js ./helpers/*.js --config",

@@ -53,2 +56,6 @@ "lint": "fixpack && npm run jshint",

"preversion": "npm test && npm run build",
"release:major": "npm version major && npm publish",
"release:minor": "npm version minor && npm publish",
"release:patch": "npm version patch && npm publish",
"release:pre": "npm version prerelease && npm publish --tag pre",
"test": "npm run detect-cycle && npm run lint && npm run testee",

@@ -55,0 +62,0 @@ "testee": "testee test.html --browsers firefox"

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