Comparing version 4.2.1 to 4.2.2
24
index.js
@@ -6,3 +6,3 @@ /** | ||
var debug = require('debug')('barracks'); | ||
var assert = require('assert'); | ||
var assert = require('assertf'); | ||
var async = require('async'); | ||
@@ -34,4 +34,4 @@ | ||
assert(actions, 'An \'actions\' object should be passed as an argument'); | ||
assert('object' == typeof actions, 'Actions should be an object'); | ||
assert(actions, 'an \'actions\' object should be passed as an argument'); | ||
assert.equal(typeof actions, 'object', 'actions should be an object'); | ||
_assertActionsObject(actions); | ||
@@ -58,4 +58,4 @@ | ||
assert('string' == typeof action, 'Action \'' + action + '\' should be a string'); | ||
assert(!this._isDispatching, 'Cannot dispatch \'' + action + '\' in the middle of a dispatch'); | ||
assert.equal(typeof action, 'string', 'action \'%s\' should be a string', action); | ||
assert(!this._isDispatching, 'cannot dispatch \'%s\' in the middle of a dispatch', action); | ||
@@ -95,3 +95,3 @@ this._isDispatching = true; | ||
done = done || function() {}; | ||
assert('function' == typeof done, 'Callback should be a function'); | ||
assert.equal(typeof done, 'function', 'callback should be a function'); | ||
@@ -123,3 +123,3 @@ actions = Array.isArray(actions) ? actions : [actions]; | ||
if ('object' == typeof action) return _assertActionsObject(action); | ||
assert('function' == typeof action, 'Action should be a function'); | ||
assert.equal(typeof action, 'function', 'action should be a function'); | ||
}); | ||
@@ -142,5 +142,5 @@ } | ||
try { | ||
assert('string' == typeof action, '.waitFor(): requires a string or array of strings'); | ||
assert.equal(typeof action, 'string', '.waitFor(): requires a string or array of strings'); | ||
if (this._isPending[action]) { | ||
assert(this._isHandled[action], 'Circular dependency detected while waiting for \'' + action + '\''); | ||
assert(this._isHandled[action], 'circular dependency detected while waiting for \'%s\'', action); | ||
} | ||
@@ -160,3 +160,3 @@ } catch(e) { | ||
debug('wait for \'' + action + '\''); | ||
debug('wait for \'%s\'', action); | ||
fn(this.locals.payload, fin.bind(this)); | ||
@@ -186,7 +186,7 @@ | ||
arr.forEach(function(obj, i) { | ||
assert(fn[arr[i]], 'Action \'' + action + '\' is not registered'); | ||
assert(fn[arr[i]], 'action \'%s\' is not registered', action); | ||
fn = fn[arr[i]]; | ||
}.bind(this)); | ||
assert('function' == typeof fn, 'Action \'' + action + '\' is not registered'); | ||
assert.equal(typeof fn, 'function', 'action \'%s\' is not registered', action); | ||
return fn.bind(this); | ||
@@ -193,0 +193,0 @@ } |
{ | ||
"name": "barracks", | ||
"version": "4.2.1", | ||
"version": "4.2.2", | ||
"description": "An event dispatcher for the flux architecture", | ||
@@ -25,2 +25,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"assertf": "^1.0.0", | ||
"async": "^0.9.0", | ||
@@ -27,0 +28,0 @@ "debug": "^1.0.4" |
12076
3
+ Addedassertf@^1.0.0
+ Addedassertf@1.0.0(transitive)
+ Addedbeforefn@2.3.1(transitive)
+ Addedsliced@0.0.5(transitive)