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

eventflow

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eventflow - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

15

eventflow.js

@@ -43,17 +43,4 @@ var async = require('async');

function countArgs (fn) {
var regex = /function(?:\s+\w+\s*|\s*)\(([^\)]*)\)/i;
var args = fn.toString().match(regex)[1].trim();
if (args.length) {
return args.split(',').length;
}
else {
return 0;
}
}
eventflow.countArgs = countArgs;
function asyncApply (thisArg, fn, args, done) {
var count = countArgs(fn);
if (count <= args.length) {
if (fn.length <= args.length) {
done(null, fn.apply(thisArg, args));

@@ -60,0 +47,0 @@ }

2

package.json
{
"name": "eventflow",
"version": "0.0.4",
"version": "0.0.5",
"description": "Flow control for your event emitters",

@@ -5,0 +5,0 @@ "main": "eventflow.js",

@@ -7,21 +7,2 @@ var eventflow = require('../'),

describe('countArgs()', function () {
it('should return 0 for a function with no arguments', function () {
function zero () {}
assert.equal(eventflow.countArgs(zero), 0);
});
it('should return 1 for a function with one argument', function () {
function one (foo) {}
assert.equal(eventflow.countArgs(one), 1);
});
it('should return 5 for a function with five arguments', function () {
function five (foo, bar, baz,boo, far) {}
assert.equal(eventflow.countArgs(five), 5);
});
});
describe('series', function() {

@@ -28,0 +9,0 @@ var emitter, result;

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