Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
? state
: stringify(
filterState(
state,
type,
filters,
stateSanitizer,
actionSanitizer,
nextActionId,
predicate
),
serializeState
);
}
if (type === 'ACTION') {
message.action = stringify(
!actionSanitizer ? action : actionSanitizer(action.action, nextActionId - 1),
serializeAction
);
message.isExcess = isExcess;
message.nextActionId = nextActionId;
} else if (instance) {
message.libConfig = {
type: 'redux',
actionCreators: stringify(instance.actionCreators),
serialize: !!instance.serialize,
};
}
postMessage({ __IS_REDUX_NATIVE_MESSAGE__: true, content: message });
}
function exportState({ id: instanceId, store, serializeState }) {
const liftedState = store.liftedStore.getState();
const actionsById = liftedState.actionsById;
const payload = [];
liftedState.stagedActionIds.slice(1).forEach(id => {
payload.push(actionsById[id].action);
});
postMessage({
__IS_REDUX_NATIVE_MESSAGE__: true,
content: {
type: 'EXPORT',
payload: stringify(payload, serializeState),
committedState:
typeof liftedState.committedState !== 'undefined'
? stringify(liftedState.committedState, serializeState)
: undefined,
instanceId,
},
});
}
function exportState({ id: instanceId, store, serializeState }) {
const liftedState = store.liftedStore.getState();
const actionsById = liftedState.actionsById;
const payload = [];
liftedState.stagedActionIds.slice(1).forEach(id => {
payload.push(actionsById[id].action);
});
postMessage({
__IS_REDUX_NATIVE_MESSAGE__: true,
content: {
type: 'EXPORT',
payload: stringify(payload, serializeState),
committedState:
typeof liftedState.committedState !== 'undefined'
? stringify(liftedState.committedState, serializeState)
: undefined,
instanceId,
},
});
}
predicate
),
serializeState
);
}
if (type === 'ACTION') {
message.action = stringify(
!actionSanitizer ? action : actionSanitizer(action.action, nextActionId - 1),
serializeAction
);
message.isExcess = isExcess;
message.nextActionId = nextActionId;
} else if (instance) {
message.libConfig = {
type: 'redux',
actionCreators: stringify(instance.actionCreators),
serialize: !!instance.serialize,
};
}
postMessage({ __IS_REDUX_NATIVE_MESSAGE__: true, content: message });
}
stateSanitizer,
actionSanitizer,
serializeState,
serializeAction,
} = instance;
const message = {
type,
id: instance.id,
name: instance.name,
};
if (state) {
message.payload =
type === 'ERROR'
? state
: stringify(
filterState(
state,
type,
filters,
stateSanitizer,
actionSanitizer,
nextActionId,
predicate
),
serializeState
);
}
if (type === 'ACTION') {
message.action = stringify(
!actionSanitizer ? action : actionSanitizer(action.action, nextActionId - 1),
serializeAction