You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
669 B
25 lines
669 B
'use strict';
|
|
|
|
exports.__esModule = true;
|
|
exports.isFSA = isFSA;
|
|
exports.isError = isError;
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
var _lodashIsplainobject = require('lodash.isplainobject');
|
|
|
|
var _lodashIsplainobject2 = _interopRequireDefault(_lodashIsplainobject);
|
|
|
|
var validKeys = ['type', 'payload', 'error', 'meta'];
|
|
|
|
function isValidKey(key) {
|
|
return validKeys.indexOf(key) > -1;
|
|
}
|
|
|
|
function isFSA(action) {
|
|
return _lodashIsplainobject2['default'](action) && typeof action.type !== 'undefined' && Object.keys(action).every(isValidKey);
|
|
}
|
|
|
|
function isError(action) {
|
|
return action.error === true;
|
|
} |