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

@pluginjs/events

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pluginjs/events - npm Package Compare versions

Comparing version 0.8.6 to 0.8.7

8

dist/events.common.js
/*!
* @pluginjs/events v0.8.6 (https://pluginjs.com)
* @pluginjs/events v0.8.7 (https://pluginjs.com)
* Copyright 2021 Creation Studio Limited

@@ -14,7 +14,3 @@ * Released under the GPL-3.0 License.

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var Emitter__default = /*#__PURE__*/_interopDefaultLegacy(Emitter);
class EventEmitter extends Emitter__default['default'] {
class EventEmitter extends Emitter {
constructor(element) {

@@ -21,0 +17,0 @@ super();

/*!
* @pluginjs/events v0.8.6 (https://pluginjs.com)
* @pluginjs/events v0.8.7 (https://pluginjs.com)
* Copyright 2021 Creation Studio Limited
* Released under the GPL-3.0 License.
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@pluginjs/is"),t=require("@pluginjs/utils");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(require("@pluginjs/emitter"));class i extends r.default{constructor(e){super(),this.element=e,this.element._eventEmitter=this}static getEventEmitter(e){return e._eventEmitter||(e._eventEmitter=new this(e)),e._eventEmitter}}var a=e=>null!==e&&"object"==typeof e&&"addEventListener"in e,s=(e,t)=>{t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n},o=e=>{var t=void 0===e.namespace?e.type:"".concat(e.type,".").concat(e.namespace),n=i.getEventEmitter(e.currentTarget);e.detail?n.emit(t,e,e.detail):n.emit(t,e)},l=(t,n,r,a,s)=>{var l=i.getEventEmitter(a),{eventName:c}=i.parseEvent(t);l.hasListeners(t)||a.addEventListener(c,o,!1);var v=((t,n,r,i)=>(t,a)=>{var s,o=t.target,l=t.currentTarget||i,c=a?[t].concat(a):[t];if(e.isString(n))for(;o&&o!==l;)Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),o.matches(n)&&(s=r.apply(o,c)),o=o.parentNode;else s=r.apply(l,c);!1===s&&(t.preventDefault(),t.stopPropagation())})(0,n,r,a);r._delegator=v,s?l.once(t,v):l.on(t,v)},c=t.curryWith(((t,n,r,a)=>{var s=t.split(" ");if(s.length>1)s.forEach((e=>{c(e,n,r,a)}));else{e.isString(n)||e.isFunction(r)||(a=r,r=n,n=void 0),e.isFunction(r)||(a=r,r=void 0);var l=t,v=i.getEventEmitter(a),{eventName:u}=i.parseEvent(l);v.hasListeners(l)&&(0===v.getListeners(l).length&&a.removeEventListener(u,o),void 0===r?v.off(l):v.off(l,r._delegator))}return a}),a),v=t.curryWith(((t,n,r,i)=>{var a=t.split(" "),s=e.isString(n)?n.split(","):null;switch(!0){case Boolean(a.length>1):a.forEach((e=>{v(e,n,r,i)}));break;case Boolean(s&&s.length>1):s.forEach((e=>{v(t,e.trim(),r,i)}));break;default:e.isString(n)||e.isFunction(r)||(i=r,r=n,n=void 0),l(t,n,r,i)}return i}),a),u=t.curryWith(((t,n,r,i)=>{var a=t.split(" "),s=e.isString(n)?n.split(","):null;switch(!0){case Boolean(a.length>1):a.forEach((e=>{u(e,n,r,i)}));break;case Boolean(s&&s.length>1):s.forEach((e=>{u(t,e.trim(),r,i)}));break;default:e.isString(n)||e.isFunction(r)||(i=r,r=n,n=void 0);var o=e=>(c(a[0],n,o,i),r(e));l(a[0],n,o,i,!0)}return i}),a),p=v,E=c,m=u;exports.bindEvent=v,exports.bindEventOnce=u,exports.getEventEmitter=e=>i.getEventEmitter(e),exports.off=E,exports.on=p,exports.once=m,exports.removeEvent=c,exports.trigger=function(e){"function"!=typeof window.CustomEvent&&(window.CustomEvent=s);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=n[n.length-1];if(a(o))if(e instanceof window.Event)o.dispatchEvent(e);else{var l=n.length>1?n.slice(0,n.length-1):null,{eventName:c,namespace:v}=i.parseEvent(e),u=new CustomEvent(c,{cancelable:!0,bubbles:!0,detail:l});v&&(u.namespace=v),o.dispatchEvent(u)}};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@pluginjs/is"),t=require("@pluginjs/utils"),n=require("@pluginjs/emitter");class r extends n{constructor(e){super(),this.element=e,this.element._eventEmitter=this}static getEventEmitter(e){return e._eventEmitter||(e._eventEmitter=new this(e)),e._eventEmitter}}var i=e=>null!==e&&"object"==typeof e&&"addEventListener"in e,a=(e,t)=>{t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n},s=e=>{var t=void 0===e.namespace?e.type:"".concat(e.type,".").concat(e.namespace),n=r.getEventEmitter(e.currentTarget);e.detail?n.emit(t,e,e.detail):n.emit(t,e)},o=(t,n,i,a,o)=>{var l=r.getEventEmitter(a),{eventName:c}=r.parseEvent(t);l.hasListeners(t)||a.addEventListener(c,s,!1);var v=((t,n,r,i)=>(t,a)=>{var s,o=t.target,l=t.currentTarget||i,c=a?[t].concat(a):[t];if(e.isString(n))for(;o&&o!==l;)Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),o.matches(n)&&(s=r.apply(o,c)),o=o.parentNode;else s=r.apply(l,c);!1===s&&(t.preventDefault(),t.stopPropagation())})(0,n,i,a);i._delegator=v,o?l.once(t,v):l.on(t,v)},l=t.curryWith(((t,n,i,a)=>{var o=t.split(" ");if(o.length>1)o.forEach((e=>{l(e,n,i,a)}));else{e.isString(n)||e.isFunction(i)||(a=i,i=n,n=void 0),e.isFunction(i)||(a=i,i=void 0);var c=t,v=r.getEventEmitter(a),{eventName:p}=r.parseEvent(c);v.hasListeners(c)&&(0===v.getListeners(c).length&&a.removeEventListener(p,s),void 0===i?v.off(c):v.off(c,i._delegator))}return a}),i),c=t.curryWith(((t,n,r,i)=>{var a=t.split(" "),s=e.isString(n)?n.split(","):null;switch(!0){case Boolean(a.length>1):a.forEach((e=>{c(e,n,r,i)}));break;case Boolean(s&&s.length>1):s.forEach((e=>{c(t,e.trim(),r,i)}));break;default:e.isString(n)||e.isFunction(r)||(i=r,r=n,n=void 0),o(t,n,r,i)}return i}),i),v=t.curryWith(((t,n,r,i)=>{var a=t.split(" "),s=e.isString(n)?n.split(","):null;switch(!0){case Boolean(a.length>1):a.forEach((e=>{v(e,n,r,i)}));break;case Boolean(s&&s.length>1):s.forEach((e=>{v(t,e.trim(),r,i)}));break;default:e.isString(n)||e.isFunction(r)||(i=r,r=n,n=void 0);var c=e=>(l(a[0],n,c,i),r(e));o(a[0],n,c,i,!0)}return i}),i),p=c,u=l,E=v;exports.bindEvent=c,exports.bindEventOnce=v,exports.getEventEmitter=e=>r.getEventEmitter(e),exports.off=u,exports.on=p,exports.once=E,exports.removeEvent=l,exports.trigger=function(e){"function"!=typeof window.CustomEvent&&(window.CustomEvent=a);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];var o=n[n.length-1];if(i(o))if(e instanceof window.Event)o.dispatchEvent(e);else{var l=n.length>1?n.slice(0,n.length-1):null,{eventName:c,namespace:v}=r.parseEvent(e),p=new CustomEvent(c,{cancelable:!0,bubbles:!0,detail:l});v&&(p.namespace=v),o.dispatchEvent(p)}};
/*!
* @pluginjs/events v0.8.6 (https://pluginjs.com)
* @pluginjs/events v0.8.7 (https://pluginjs.com)
* Copyright 2021 Creation Studio Limited

@@ -4,0 +4,0 @@ * Released under the GPL-3.0 License.

/*!
* @pluginjs/events v0.8.6 (https://pluginjs.com)
* @pluginjs/events v0.8.7 (https://pluginjs.com)
* Copyright 2021 Creation Studio Limited

@@ -4,0 +4,0 @@ * Released under the GPL-3.0 License.

/*!
* @pluginjs/events v0.8.6 (https://pluginjs.com)
* @pluginjs/events v0.8.7 (https://pluginjs.com)
* Copyright 2021 Creation Studio Limited

@@ -12,6 +12,2 @@ * Released under the GPL-3.0 License.

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var Emitter__default = /*#__PURE__*/_interopDefaultLegacy(Emitter);
function _typeof(obj) {

@@ -162,3 +158,3 @@ "@babel/helpers - typeof";

return EventEmitter;
}(Emitter__default['default']);
}(Emitter);

@@ -165,0 +161,0 @@ var supportEventListener = function supportEventListener(element) {

/*!
* @pluginjs/events v0.8.6 (https://pluginjs.com)
* @pluginjs/events v0.8.7 (https://pluginjs.com)
* Copyright 2021 Creation Studio Limited
* Released under the GPL-3.0 License.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@pluginjs/is"),require("@pluginjs/utils"),require("@pluginjs/emitter")):"function"==typeof define&&define.amd?define(["exports","@pluginjs/is","@pluginjs/utils","@pluginjs/emitter"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@pluginjs/events"]={},e["@pluginjs/is"],e["@pluginjs/utils"],e["@pluginjs/emitter"])}(this,(function(e,t,n,r){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?l(e):t}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var o=c(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return f(this,n)}}var p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(i,e);var t,n,r,o=s(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this)).element=e,t.element._eventEmitter=l(t),t}return t=i,r=[{key:"getEventEmitter",value:function(e){return e._eventEmitter||(e._eventEmitter=new this(e)),e._eventEmitter}}],(n=null)&&u(t.prototype,n),r&&u(t,r),i}(o(r).default),v=function(e){return null!==e&&"object"===i(e)&&"addEventListener"in e},m=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n},y=function(e){var t=void 0===e.namespace?e.type:"".concat(e.type,".").concat(e.namespace),n=p.getEventEmitter(e.currentTarget);e.detail?n.emit(t,e,e.detail):n.emit(t,e)},d=function(e,n,r,o,i){var u=p.getEventEmitter(o),c=p.parseEvent(e).eventName;u.hasListeners(e)||o.addEventListener(c,y,!1);var a=function(e,n,r,o){return function(e,i){var u,c=e.target,a=e.currentTarget||o,l=i?[e].concat(i):[e];if(t.isString(n))for(;c&&c!==a;)Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),c.matches(n)&&(u=r.apply(c,l)),c=c.parentNode;else u=r.apply(a,l);!1===u&&(e.preventDefault(),e.stopPropagation())}}(0,n,r,o);r._delegator=a,i?u.once(e,a):u.on(e,a)},g=n.curryWith((function(e,n,r,o){var i=e.split(" ");if(i.length>1)i.forEach((function(e){g(e,n,r,o)}));else{t.isString(n)||t.isFunction(r)||(o=r,r=n,n=void 0),t.isFunction(r)||(o=r,r=void 0);var u=e,c=p.getEventEmitter(o),a=p.parseEvent(u).eventName;c.hasListeners(u)&&(0===c.getListeners(u).length&&o.removeEventListener(a,y),void 0===r?c.off(u):c.off(u,r._delegator))}return o}),v),b=n.curryWith((function(e,n,r,o){var i=e.split(" "),u=t.isString(n)?n.split(","):null;switch(!0){case Boolean(i.length>1):i.forEach((function(e){b(e,n,r,o)}));break;case Boolean(u&&u.length>1):u.forEach((function(t){b(e,t.trim(),r,o)}));break;default:t.isString(n)||t.isFunction(r)||(o=r,r=n,n=void 0),d(e,n,r,o)}return o}),v),h=n.curryWith((function(e,n,r,o){var i=e.split(" "),u=t.isString(n)?n.split(","):null;switch(!0){case Boolean(i.length>1):i.forEach((function(e){h(e,n,r,o)}));break;case Boolean(u&&u.length>1):u.forEach((function(t){h(e,t.trim(),r,o)}));break;default:t.isString(n)||t.isFunction(r)||(o=r,r=n,n=void 0);d(i[0],n,(function e(t){return g(i[0],n,e,o),r(t)}),o,!0)}return o}),v),E=b,j=g,w=h;e.bindEvent=b,e.bindEventOnce=h,e.getEventEmitter=function(e){return p.getEventEmitter(e)},e.off=j,e.on=E,e.once=w,e.removeEvent=g,e.trigger=function(e){"function"!=typeof window.CustomEvent&&(window.CustomEvent=m);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=n[n.length-1];if(v(o))if(e instanceof window.Event)o.dispatchEvent(e);else{var i=n.length>1?n.slice(0,n.length-1):null,u=p.parseEvent(e),c=u.eventName,a=u.namespace,l=new CustomEvent(c,{cancelable:!0,bubbles:!0,detail:i});a&&(l.namespace=a),o.dispatchEvent(l)}},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@pluginjs/is"),require("@pluginjs/utils"),require("@pluginjs/emitter")):"function"==typeof define&&define.amd?define(["exports","@pluginjs/is","@pluginjs/utils","@pluginjs/emitter"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@pluginjs/events"]={},e["@pluginjs/is"],e["@pluginjs/utils"],e["@pluginjs/emitter"])}(this,(function(e,t,n,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?a(e):t}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(u,e);var t,n,r,o=s(u);function u(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(t=o.call(this)).element=e,t.element._eventEmitter=a(t),t}return t=u,r=[{key:"getEventEmitter",value:function(e){return e._eventEmitter||(e._eventEmitter=new this(e)),e._eventEmitter}}],(n=null)&&i(t.prototype,n),r&&i(t,r),u}(r),p=function(e){return null!==e&&"object"===o(e)&&"addEventListener"in e},v=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n},m=function(e){var t=void 0===e.namespace?e.type:"".concat(e.type,".").concat(e.namespace),n=f.getEventEmitter(e.currentTarget);e.detail?n.emit(t,e,e.detail):n.emit(t,e)},y=function(e,n,r,o,i){var u=f.getEventEmitter(o),c=f.parseEvent(e).eventName;u.hasListeners(e)||o.addEventListener(c,m,!1);var a=function(e,n,r,o){return function(e,i){var u,c=e.target,a=e.currentTarget||o,l=i?[e].concat(i):[e];if(t.isString(n))for(;c&&c!==a;)Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),c.matches(n)&&(u=r.apply(c,l)),c=c.parentNode;else u=r.apply(a,l);!1===u&&(e.preventDefault(),e.stopPropagation())}}(0,n,r,o);r._delegator=a,i?u.once(e,a):u.on(e,a)},g=n.curryWith((function(e,n,r,o){var i=e.split(" ");if(i.length>1)i.forEach((function(e){g(e,n,r,o)}));else{t.isString(n)||t.isFunction(r)||(o=r,r=n,n=void 0),t.isFunction(r)||(o=r,r=void 0);var u=e,c=f.getEventEmitter(o),a=f.parseEvent(u).eventName;c.hasListeners(u)&&(0===c.getListeners(u).length&&o.removeEventListener(a,m),void 0===r?c.off(u):c.off(u,r._delegator))}return o}),p),h=n.curryWith((function(e,n,r,o){var i=e.split(" "),u=t.isString(n)?n.split(","):null;switch(!0){case Boolean(i.length>1):i.forEach((function(e){h(e,n,r,o)}));break;case Boolean(u&&u.length>1):u.forEach((function(t){h(e,t.trim(),r,o)}));break;default:t.isString(n)||t.isFunction(r)||(o=r,r=n,n=void 0),y(e,n,r,o)}return o}),p),b=n.curryWith((function(e,n,r,o){var i=e.split(" "),u=t.isString(n)?n.split(","):null;switch(!0){case Boolean(i.length>1):i.forEach((function(e){b(e,n,r,o)}));break;case Boolean(u&&u.length>1):u.forEach((function(t){b(e,t.trim(),r,o)}));break;default:t.isString(n)||t.isFunction(r)||(o=r,r=n,n=void 0);y(i[0],n,(function e(t){return g(i[0],n,e,o),r(t)}),o,!0)}return o}),p),d=h,E=g,j=b;e.bindEvent=h,e.bindEventOnce=b,e.getEventEmitter=function(e){return f.getEventEmitter(e)},e.off=E,e.on=d,e.once=j,e.removeEvent=g,e.trigger=function(e){"function"!=typeof window.CustomEvent&&(window.CustomEvent=v);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=n[n.length-1];if(p(o))if(e instanceof window.Event)o.dispatchEvent(e);else{var i=n.length>1?n.slice(0,n.length-1):null,u=f.parseEvent(e),c=u.eventName,a=u.namespace,l=new CustomEvent(c,{cancelable:!0,bubbles:!0,detail:i});a&&(l.namespace=a),o.dispatchEvent(l)}},Object.defineProperty(e,"__esModule",{value:!0})}));

@@ -14,3 +14,3 @@ {

},
"version": "0.8.6",
"version": "0.8.7",
"category": "utils",

@@ -37,5 +37,5 @@ "main": "dist/events.common.js",

"dependencies": {
"@pluginjs/emitter": "^0.8.5",
"@pluginjs/is": "^0.8.5",
"@pluginjs/utils": "^0.8.5"
"@pluginjs/emitter": "^0.8.6",
"@pluginjs/is": "^0.8.6",
"@pluginjs/utils": "^0.8.6"
},

@@ -45,3 +45,3 @@ "devDependencies": {

"@pluginjs/browserslist-config": "^1.3.2",
"@pluginjs/cli": "^0.8.2",
"@pluginjs/cli": "^0.8.3",
"@rollup/plugin-commonjs": "^17.1.0",

@@ -48,0 +48,0 @@ "@rollup/plugin-node-resolve": "^11.1.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