redux-action-asserter
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -17,6 +17,2 @@ 'use strict'; | ||
var _matches = require('lodash/matches'); | ||
var _matches2 = _interopRequireDefault(_matches); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -65,3 +61,10 @@ | ||
return this.actions.find(function (dispatchedAction) { | ||
return (0, _matches2.default)(action, dispatchedAction); | ||
for (var key in dispatchedAction) { | ||
if (dispatchedAction.hasOwnProperty(key)) { | ||
if (!(0, _isEqual2.default)(dispatchedAction[key], action[key])) { | ||
return false; | ||
} | ||
} | ||
} | ||
return true; | ||
}) !== undefined; | ||
@@ -68,0 +71,0 @@ } |
12
index.js
import isEqual from 'lodash/isEqual' | ||
import isFunction from 'lodash/isFunction' | ||
import matches from 'lodash/matches' | ||
@@ -30,3 +29,12 @@ export default class ActionAsserter { | ||
dispatchedAction (action) { | ||
return this.actions.find((dispatchedAction) => matches(action, dispatchedAction)) !== undefined | ||
return this.actions.find((dispatchedAction) => { | ||
for (const key in dispatchedAction) { | ||
if (dispatchedAction.hasOwnProperty(key)) { | ||
if (!isEqual(dispatchedAction[key], action[key])) { | ||
return false | ||
} | ||
} | ||
} | ||
return true | ||
}) !== undefined | ||
} | ||
@@ -33,0 +41,0 @@ |
{ | ||
"name": "redux-action-asserter", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"main": "dist/main.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
9147
115