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

@govflanders/vl-widget-event

Package Overview
Dependencies
Maintainers
13
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@govflanders/vl-widget-event - npm Package Compare versions

Comparing version 1.1.29 to 1.1.30

2

dist/index.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var eventemitter2=require("eventemitter2"),vlWidgetUtility=require("@govflanders/vl-widget-utility");!function(t){t.Self="self",t.Broadcast="broadcast"}(exports.EventScope||(exports.EventScope={}));var defaults=function(t,e){for(var n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++){var o=n[r],i=Object.getOwnPropertyDescriptor(e,o);i&&i.configurable&&void 0===t[o]&&Object.defineProperty(t,o,i)}return t},_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},__extends=function(){var t=function(e,n){return(t=Object.setPrototypeOf||_extends({},[])instanceof Array&&function(t,e){defaults(t,e)}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function suppressEventEmitter2UnhandledError(){}var EventEmitterBase=function(){function t(t){this.emitter=new eventemitter2.EventEmitter2(t),this.subscribedEventBroadcasts=[],this.eventLocks={},this.emitter.on("error",suppressEventEmitter2UnhandledError)}return t.prototype.hasEventLock=function(t){return!!this.eventLocks[t.getEventId()]},t.prototype.acquireEventLock=function(t){return this.eventLocks[t.getEventId()]=!0,this},t.prototype.releaseEventLock=function(t){return delete this.eventLocks[t.getEventId()],this},t.prototype.resolveEventBroadcast=function(t){var e=null;"function"==typeof t.getEventBroadcast?e=t.getEventBroadcast():"function"==typeof t&&(e=t);return e},t.prototype.createEventBroadcast=function(){var t=this;return function(e){return t.emit(e)}},t.prototype.getEventBroadcast=function(){return void 0===this.eventBroadcast&&(this.eventBroadcast=this.createEventBroadcast()),this.eventBroadcast},t.prototype.on=function(t,e){return this.addEventListener(t,e)},t.prototype.off=function(t,e){return this.removeEventListener(t,e)},t.prototype.once=function(t,e){return this.emitter.once(t,e),this},t.prototype.addEventListener=function(t,e){for(var n=0,r=Array.isArray(t)?t:[t];n<r.length;n++){var o=r[n];this.emitter.addListener(o,e)}return this},t.prototype.removeEventListener=function(t,e){for(var n=0,r=Array.isArray(t)?t:[t];n<r.length;n++){var o=r[n];this.emitter.removeListener(o,e)}return this},t.prototype.addEventBroadcast=function(t){var e=this.resolveEventBroadcast(t);return null!==e&&-1===this.subscribedEventBroadcasts.indexOf(e)&&this.subscribedEventBroadcasts.push(e),this},t.prototype.removeEventBroadcast=function(t){var e=this.resolveEventBroadcast(t);if(null!==e){var n=this.subscribedEventBroadcasts.indexOf(e);n>-1&&this.subscribedEventBroadcasts.slice(n,1)}return this},t.prototype.emit=function(t){var e=this;return new Promise(function(n,r){if(e.hasEventLock(t))n();else{e.acquireEventLock(t);var o=[e.emitter.emitAsync(t.getEventName(),t)];t.getEventScope()===exports.EventScope.Broadcast&&e.subscribedEventBroadcasts.forEach(function(e){o.push(e(t))}),Promise.all(o).then(function(){e.releaseEventLock(t),n()}).catch(function(n){e.releaseEventLock(t),r(n)})}})},t}(),defaultEventEmitterOptions={newListener:!1,maxListeners:0},DefaultEventEmitter=function(t){function e(e){return t.call(this,Object.assign({},defaultEventEmitterOptions,e))||this}return __extends(e,t),e}(EventEmitterBase),EventSourceBase=function(){function t(){}return t.prototype.createEventEmitter=function(){return new DefaultEventEmitter},t.prototype.getEventEmitter=function(){return void 0===this.eventEmitter&&(this.eventEmitter=this.createEventEmitter()),this.eventEmitter},t.prototype.getEventBroadcast=function(){return this.getEventEmitter().getEventBroadcast()},t.prototype.on=function(t,e){return this.getEventEmitter().on(t,e),this},t.prototype.off=function(t,e){return this.getEventEmitter().off(t,e),this},t.prototype.once=function(t,e){return this.getEventEmitter().once(t,e),this},t.prototype.addEventListener=function(t,e){return this.getEventEmitter().addEventListener(t,e),this},t.prototype.removeEventListener=function(t,e){return this.getEventEmitter().removeEventListener(t,e),this},t.prototype.addEventBroadcast=function(t){return this.getEventEmitter().addEventBroadcast(t),this},t.prototype.removeEventBroadcast=function(t){return this.getEventEmitter().removeEventBroadcast(t),this},t.prototype.emit=function(t){return this.getEventEmitter().emit(t)},t}(),__extends$1=function(){var t=function(e,n){return(t=Object.setPrototypeOf||_extends({},[])instanceof Array&&function(t,e){defaults(t,e)}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),EventBase=function(){function t(t,e,n){void 0===n&&(n=exports.EventScope.Broadcast),this.eventId=vlWidgetUtility.Uuid.generate(),this.eventName=t,this.sender=e,this.eventScope=n}return t.prototype.getEventId=function(){return this.eventId},t.prototype.getEventScope=function(){return this.eventScope},t.prototype.getEventName=function(){return this.eventName},t.prototype.getSender=function(){return this.sender},t.prototype.rename=function(t){var e=Object.create(this);return e.eventName=t,e},t.prototype.prefix=function(t){var e=this.getEventName();return t.length>0&&(e=t+"."+e),this.rename(e)},t.prototype.suffix=function(t){var e=this.getEventName();return t.length>0&&(e=e+"."+t),this.rename(e)},t}(),CustomEvent=function(t){function e(e,n,r,o){void 0===o&&(o=exports.EventScope.Broadcast);var i=t.call(this,e,n,o)||this;return i.eventData=r,i}return __extends$1(e,t),e.prototype.getEventData=function(){return this.eventData},e}(EventBase);exports.EventEmitterBase=EventEmitterBase,exports.defaultEventEmitterOptions=defaultEventEmitterOptions,exports.DefaultEventEmitter=DefaultEventEmitter,exports.EventSourceBase=EventSourceBase,exports.EventBase=EventBase,exports.CustomEvent=CustomEvent;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var eventemitter2=require("eventemitter2"),vlWidgetUtility=require("@govflanders/vl-widget-utility"),extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function __extends(t,e){function n(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function suppressEventEmitter2UnhandledError(){}!function(t){t.Self="self",t.Broadcast="broadcast"}(exports.EventScope||(exports.EventScope={}));var EventEmitterBase=function(){function t(t){this.emitter=new eventemitter2.EventEmitter2(t),this.subscribedEventBroadcasts=[],this.eventLocks={},this.emitter.on("error",suppressEventEmitter2UnhandledError)}return t.prototype.hasEventLock=function(t){return!!this.eventLocks[t.getEventId()]},t.prototype.acquireEventLock=function(t){return this.eventLocks[t.getEventId()]=!0,this},t.prototype.releaseEventLock=function(t){return delete this.eventLocks[t.getEventId()],this},t.prototype.resolveEventBroadcast=function(t){var e=null;"function"==typeof t.getEventBroadcast?e=t.getEventBroadcast():"function"==typeof t&&(e=t);return e},t.prototype.createEventBroadcast=function(){var e=this;return function(t){return e.emit(t)}},t.prototype.getEventBroadcast=function(){return void 0===this.eventBroadcast&&(this.eventBroadcast=this.createEventBroadcast()),this.eventBroadcast},t.prototype.on=function(t,e){return this.addEventListener(t,e)},t.prototype.off=function(t,e){return this.removeEventListener(t,e)},t.prototype.once=function(t,e){return this.emitter.once(t,e),this},t.prototype.addEventListener=function(t,e){for(var n=0,r=Array.isArray(t)?t:[t];n<r.length;n++){var o=r[n];this.emitter.addListener(o,e)}return this},t.prototype.removeEventListener=function(t,e){for(var n=0,r=Array.isArray(t)?t:[t];n<r.length;n++){var o=r[n];this.emitter.removeListener(o,e)}return this},t.prototype.addEventBroadcast=function(t){var e=this.resolveEventBroadcast(t);return null!==e&&-1===this.subscribedEventBroadcasts.indexOf(e)&&this.subscribedEventBroadcasts.push(e),this},t.prototype.removeEventBroadcast=function(t){var e=this.resolveEventBroadcast(t);if(null!==e){var n=this.subscribedEventBroadcasts.indexOf(e);-1<n&&this.subscribedEventBroadcasts.slice(n,1)}return this},t.prototype.emit=function(r){var o=this;return new Promise(function(t,e){if(o.hasEventLock(r))t();else{o.acquireEventLock(r);var n=[o.emitter.emitAsync(r.getEventName(),r)];r.getEventScope()===exports.EventScope.Broadcast&&o.subscribedEventBroadcasts.forEach(function(t){n.push(t(r))}),Promise.all(n).then(function(){o.releaseEventLock(r),t()}).catch(function(t){o.releaseEventLock(r),e(t)})}})},t}(),defaultEventEmitterOptions={newListener:!1,maxListeners:0},DefaultEventEmitter=function(e){function t(t){return e.call(this,Object.assign({},defaultEventEmitterOptions,t))||this}return __extends(t,e),t}(EventEmitterBase),EventSourceBase=function(){function t(){}return t.prototype.createEventEmitter=function(){return new DefaultEventEmitter},t.prototype.getEventEmitter=function(){return void 0===this.eventEmitter&&(this.eventEmitter=this.createEventEmitter()),this.eventEmitter},t.prototype.getEventBroadcast=function(){return this.getEventEmitter().getEventBroadcast()},t.prototype.on=function(t,e){return this.getEventEmitter().on(t,e),this},t.prototype.off=function(t,e){return this.getEventEmitter().off(t,e),this},t.prototype.once=function(t,e){return this.getEventEmitter().once(t,e),this},t.prototype.addEventListener=function(t,e){return this.getEventEmitter().addEventListener(t,e),this},t.prototype.removeEventListener=function(t,e){return this.getEventEmitter().removeEventListener(t,e),this},t.prototype.addEventBroadcast=function(t){return this.getEventEmitter().addEventBroadcast(t),this},t.prototype.removeEventBroadcast=function(t){return this.getEventEmitter().removeEventBroadcast(t),this},t.prototype.emit=function(t){return this.getEventEmitter().emit(t)},t}(),EventBase=function(){function t(t,e,n){void 0===n&&(n=exports.EventScope.Broadcast),this.eventId=vlWidgetUtility.Uuid.generate(),this.eventName=t,this.sender=e,this.eventScope=n}return t.prototype.getEventId=function(){return this.eventId},t.prototype.getEventScope=function(){return this.eventScope},t.prototype.getEventName=function(){return this.eventName},t.prototype.getSender=function(){return this.sender},t.prototype.rename=function(t){var e=Object.create(this);return e.eventName=t,e},t.prototype.prefix=function(t){var e=this.getEventName();return 0<t.length&&(e=t+"."+e),this.rename(e)},t.prototype.suffix=function(t){var e=this.getEventName();return 0<t.length&&(e=e+"."+t),this.rename(e)},t}(),CustomEvent=function(i){function t(t,e,n,r){void 0===r&&(r=exports.EventScope.Broadcast);var o=i.call(this,t,e,r)||this;return o.eventData=n,o}return __extends(t,i),t.prototype.getEventData=function(){return this.eventData},t}(EventBase);exports.CustomEvent=CustomEvent,exports.DefaultEventEmitter=DefaultEventEmitter,exports.EventBase=EventBase,exports.EventEmitterBase=EventEmitterBase,exports.EventSourceBase=EventSourceBase,exports.defaultEventEmitterOptions=defaultEventEmitterOptions;
{
"name": "@govflanders/vl-widget-event",
"version": "1.1.29",
"version": "1.1.30",
"license": "MIT",

@@ -19,6 +19,5 @@ "contributors": [

"scripts": {
"build": "rimraf types && rimraf dist && tsc && rollup -c rollup.config.js && rimraf compiled",
"prepublishOnly": "export NODE_ENV=production && yarn run test && yarn run build",
"test:lint": "tslint --project . 'src/**/*.ts'",
"test": "yarn run test:lint"
"build": "npx yarn clean && npx rollup -c rollup.config.js",
"clean": "npx rimraf dist && npx rimraf types",
"prepublishOnly": "export NODE_ENV=production && npx yarn build"
},

@@ -28,21 +27,5 @@ "main": "dist/index.js",

"dependencies": {
"@govflanders/vl-widget-utility": "^1.1.29",
"@govflanders/vl-widget-utility": "^1.1.30",
"eventemitter2": "5.0.1"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-es3-member-expression-literals": "^6.22.0",
"babel-plugin-transform-es3-property-literals": "^6.22.0",
"babel-preset-es2015-ie-native-modules": "^6.6.2",
"rimraf": "^2.6.2",
"rollup": "^0.55.3",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-uglify": "^3.0.0",
"tslint": "^5.9.1",
"tslint-config-airbnb": "^5.6.0",
"typescript": "^3.0.0",
"yarn": "^1.3.2"
}
}

@@ -6,2 +6,7 @@ import { EventEmitter2 as InternalEventEmitter, ConstructorOptions } from 'eventemitter2';

/**
* Interface which describes the event emitter options.
*/
export interface EventEmitterOptions extends ConstructorOptions {
}
/**
* Interface which describes an event emitter.

@@ -54,7 +59,7 @@ */

*
* @param {ConstructorOptions} options
* @param {EventEmitterOptions} options
* Optional. An object which contains the emitter
* options.
*/
constructor(options?: ConstructorOptions);
constructor(options?: EventEmitterOptions);
/**

@@ -61,0 +66,0 @@ * Get a value indicating whether given event is locked.

@@ -0,0 +0,0 @@ import { Event as IEvent } from './event';

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ import { EventEmitter } from './event-emitter';

@@ -0,0 +0,0 @@ import { Event as IEvent } from './event';

@@ -0,0 +0,0 @@ import { EventScope } from './event-scope';

@@ -0,0 +0,0 @@ export * from './event-emitter';

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