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

conglomerate-dom-event

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conglomerate-dom-event - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

4

dist/index.js
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.conglomerateDomEvent = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
//
// conglomerate-dom-event 2.0.3
// conglomerate-dom-event 2.2.0
//
// conglomerate-dom-event is released under the terms of the MIT license.
// conglomerate-dom-event is released under the terms of the BSD-3-Clause license.
// (c) 2015 - 2016 FT Labs <enquiries@labs.ft.com> http://labs.ft.com/

@@ -8,0 +8,0 @@ //

//
// conglomerate-dom-event 2.0.3
// conglomerate-dom-event 2.2.0
//
// conglomerate-dom-event is released under the terms of the MIT license.
// conglomerate-dom-event is released under the terms of the BSD-3-Clause license.
// (c) 2015 - 2016 FT Labs <enquiries@labs.ft.com> http://labs.ft.com/

@@ -10,3 +10,2 @@ //

//
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.conglomerateDomEvent=e()}}(function(){return function e(t,r,n){function o(s,a){if(!r[s]){if(!t[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(i)return i(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var f=r[s]={exports:{}};t[s][0].call(f.exports,function(e){var r=t[s][1][e];return o(r?r:e)},f,f.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(e,t,r){"use strict";function n(e){this.listenerMap=[{},{}],e&&this.root(e),this.handle=n.prototype.handle.bind(this)}function o(e,t){return e.toLowerCase()===t.tagName.toLowerCase()}function i(e,t){return this.rootElement===window?t===document||t===document.body.parentElement:this.rootElement===t}function s(e,t){return e===t.id}n.prototype.root=function(e){var t=this.listenerMap,r=void 0;if(this.rootElement){for(r in t[1])t[1].hasOwnProperty(r)&&this.rootElement.removeEventListener(r,this.handle,!0);for(r in t[0])t[0].hasOwnProperty(r)&&this.rootElement.removeEventListener(r,this.handle,!1)}if(!e||!e.addEventListener)return this.rootElement&&delete this.rootElement,this;this.rootElement=e;for(r in t[1])t[1].hasOwnProperty(r)&&this.rootElement.addEventListener(r,this.handle,!0);for(r in t[0])t[0].hasOwnProperty(r)&&this.rootElement.addEventListener(r,this.handle,!1);return this},n.prototype.captureForType=function(e){return-1!==["blur","error","focus","load","resize","scroll"].indexOf(e)},n.prototype.off=function(e,t,r,n){var o=void 0,i=void 0;if("function"==typeof t&&(n=r,r=t,t=null),void 0===n)return this.off(e,t,r,!0),this.off(e,t,r,!1),this;var s=this.listenerMap[n?1:0];if(!e){for(i in s)s.hasOwnProperty(i)&&this.off(i,t,r);return this}var a=s[e];if(!a||!a.length)return this;for(o=a.length-1;o>=0;o--){var h=a[o];t&&t!==h.selector||r&&r!==h.handler||a.splice(o,1)}return a.length||(delete s[e],this.rootElement&&this.rootElement.removeEventListener(e,this.handle,n)),this},n.prototype.handle=function(e){var t=void 0,r=void 0,n=void 0,o=[],i=void 0,s="ftLabsDelegateIgnore",a=e.type;if(e[s]!==!0){i=e.target,3===i.nodeType&&(i=i.parentNode);var h=this.rootElement,l=e.eventPhase||(e.target!==e.currentTarget?3:2);switch(l){case 1:o=this.listenerMap[1][a];break;case 2:this.listenerMap[0]&&this.listenerMap[0][a]&&(o=o.concat(this.listenerMap[0][a])),this.listenerMap[1]&&this.listenerMap[1][a]&&(o=o.concat(this.listenerMap[1][a]));break;case 3:o=this.listenerMap[0][a]}for(r=o.length;i&&r;){for(t=0;r>t;t++){var f=o[t];if(!f)break;if(f.matcher.call(i,f.matcherParam,i)&&(n=this.fire(e,i,f)),n===!1)return e[s]=!0,void e.preventDefault()}if(i===h)break;r=o.length,i=i.parentElement}}},n.prototype.fire=function(e,t,r){return r.handler.call(t,e,t)};var a=function(e){if(e){var t=e.prototype;return t.matches||t.matchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector}}(Element);n.prototype.on=function(e,t,r,n){var h=void 0,l=void 0;if(!e)throw new TypeError("Invalid event type: "+e);if("function"==typeof t&&(n=r,r=t,t=null),void 0===n&&(n=this.captureForType(e)),"function"!=typeof r)throw new TypeError("Handler must be a type of Function");var f=this.rootElement,u=this.listenerMap[n?1:0];return u[e]||(f&&f.addEventListener(e,this.handle,n),u[e]=[]),t?/^[a-z]+$/i.test(t)?(l=t,h=o):/^#[a-z0-9\-_]+$/i.test(t)?(l=t.slice(1),h=s):(l=t,h=a):(l=null,h=i.bind(this)),u[e].push({selector:t,handler:r,matcher:h,matcherParam:l}),this},n.prototype.destroy=function(){this.off(),this.root()},t.exports=n},{}]},{},[1])(1)});
//
// conglomerate-dom-event 2.0.3
// conglomerate-dom-event 2.2.0
//
// conglomerate-dom-event is released under the terms of the MIT license.
// conglomerate-dom-event is released under the terms of the BSD-3-Clause license.
// (c) 2015 - 2016 FT Labs <enquiries@labs.ft.com> http://labs.ft.com/

@@ -11,3 +11,2 @@ //

'use strict';

@@ -14,0 +13,0 @@

//
// conglomerate-dom-event 2.0.3
// conglomerate-dom-event 2.2.0
//
// conglomerate-dom-event is released under the terms of the MIT license.
// conglomerate-dom-event is released under the terms of the BSD-3-Clause license.
// (c) 2015 - 2016 FT Labs <enquiries@labs.ft.com> http://labs.ft.com/

@@ -11,3 +11,2 @@ //

/**

@@ -49,4 +48,4 @@ * DOM event delegator

Delegate.prototype.root = function (root) {
var listenerMap = this.listenerMap;
var eventType = void 0;
const listenerMap = this.listenerMap;
let eventType;

@@ -119,4 +118,3 @@ // Remove master event listeners

Delegate.prototype.off = function (eventType, selector, handler, useCapture) {
var i = void 0,
singleEventType = void 0;
let i, singleEventType;

@@ -140,3 +138,3 @@ // Handler can be passed as

var listenerMap = this.listenerMap[useCapture ? 1 : 0];
const listenerMap = this.listenerMap[useCapture ? 1 : 0];
if (!eventType) {

@@ -152,3 +150,3 @@ for (singleEventType in listenerMap) {

var listenerList = listenerMap[eventType];
const listenerList = listenerMap[eventType];
if (!listenerList || !listenerList.length) {

@@ -161,3 +159,3 @@ return this;

for (i = listenerList.length - 1; i >= 0; i--) {
var listener = listenerList[i];
const listener = listenerList[i];

@@ -188,9 +186,9 @@ if ((!selector || selector === listener.selector) && (!handler || handler === listener.handler)) {

Delegate.prototype.handle = function (event) {
var i = void 0,
l = void 0,
returned = void 0,
let i,
l,
returned,
listenerList = [],
target = void 0;
var EVENTIGNORE = 'ftLabsDelegateIgnore';
var type = event.type;
target;
const EVENTIGNORE = 'ftLabsDelegateIgnore';
const type = event.type;

@@ -209,5 +207,5 @@ if (event[EVENTIGNORE] === true) {

var root = this.rootElement;
const root = this.rootElement;
var phase = event.eventPhase || (event.target !== event.currentTarget ? 3 : 2);
const phase = event.eventPhase || (event.target !== event.currentTarget ? 3 : 2);

@@ -239,3 +237,3 @@ switch (phase) {

for (i = 0; i < l; i++) {
var listener = listenerList[i];
const listener = listenerList[i];

@@ -306,5 +304,5 @@ // Bail from this loop if

*/
var matches = function (el) {
const matches = function (el) {
if (!el) return;
var p = el.prototype;
const p = el.prototype;
// eslint-disable-next-line consistent-return

@@ -385,4 +383,3 @@ return p.matches || p.matchesSelector || p.webkitMatchesSelector || p.mozMatchesSelector || p.msMatchesSelector || p.oMatchesSelector;

Delegate.prototype.on = function (eventType, selector, handler, useCapture) {
var matcher = void 0,
matcherParam = void 0;
let matcher, matcherParam;

@@ -412,4 +409,4 @@ if (!eventType) {

var root = this.rootElement;
var listenerMap = this.listenerMap[useCapture ? 1 : 0];
const root = this.rootElement;
const listenerMap = this.listenerMap[useCapture ? 1 : 0];

@@ -445,6 +442,6 @@ // Add master handler for type if not created yet

listenerMap[eventType].push({
selector: selector,
handler: handler,
matcher: matcher,
matcherParam: matcherParam
selector,
handler,
matcher,
matcherParam
});

@@ -451,0 +448,0 @@

//
// conglomerate-dom-event 2.0.3
// conglomerate-dom-event 2.2.0
//
// conglomerate-dom-event is released under the terms of the MIT license.
// conglomerate-dom-event is released under the terms of the BSD-3-Clause license.
// (c) 2015 - 2016 FT Labs <enquiries@labs.ft.com> http://labs.ft.com/

@@ -11,3 +11,2 @@ //

'use strict';

@@ -14,0 +13,0 @@

{
"name": "conglomerate-dom-event",
"version": "2.2.0",
"version": "2.2.1",
"author": "FT Labs <enquiries@labs.ft.com> (http://labs.ft.com/)",

@@ -5,0 +5,0 @@ "description": "Create and manage a DOM event delegator.",

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