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

glob-events

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glob-events - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

7

CHANGES.md
# Changes
## 0.4.0
- Pass on given event object as scope
- Expose event name on scope
- Expose args on scope
- Expose given options on scope
## 0.3.0

@@ -4,0 +11,0 @@

20

lib/events.js

@@ -39,22 +39,28 @@ /*

emit: function (event) {
var opts;
var opts, scope;
if (typeof event === 'object') {
scope = event;
opts = options(event);
event = event.event;
} else {
scope = { event : event };
}
if (typeof event !== 'string') {
if (typeof scope.event !== 'string') {
throw new TypeError(E_EVENT);
}
var i = this._store.iterator(event, opts), fn, l = arguments.length, a, j;
var i = this._store.iterator(scope.event, opts),
l = arguments.length,
fn;
if (l > 1) {
a = [];
var a = [], j;
for (j = 1; j < l; j++) {
a[j - 1] = arguments[j];
}
scope.args = a;
while ((fn = i.next()) !== undefined) {
fn.apply(null, a);
fn.apply(scope, a);
}
} else {
scope.args = [];
while ((fn = i.next()) !== undefined) {
fn();
fn.call(scope);
}

@@ -61,0 +67,0 @@ }

{
"name" : "glob-events",
"version" : "0.3.0",
"version" : "0.4.0",
"description" : "Event emitter with glob support on event names",

@@ -13,6 +13,6 @@ "keywords" : ["event", "emitter", "glob", "listener"],

"scripts" : {
"start" : "mochify --watch --node --cover",
"start" : "mochify --watch --node",
"lint" : "jslint --color './**/*.js'",
"test-wd" : "mochify --wd",
"test" : "npm run lint && mocha -R spec && mochify --cover"
"test" : "npm run lint && mocha && mochify --cover"
},

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

"devDependencies" : {
"mocha" : ">=1.17 <2",
"jslint" : "~0.3.1",
"mochify" : "~0.7.0",
"mocha" : "^1.17",
"jslint" : "~0.3.3",
"mochify" : "~0.8.2",
"bench" : "~0.3.5"

@@ -32,0 +32,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