Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
diffProfiles (oldProfile, newProfile) {
// This method will return added or modified entries.
let diff = detailedDiff(oldProfile, newProfile)
return Object.assign(diff.added, diff.updated)
}
store.subscribe ( () => {
const date = new Date (),
timestamp = `[${padLeft ( date.getHours (), 2, 0 )}:${padLeft ( date.getMinutes (), 2, 0 )}:${padLeft ( date.getSeconds (), 2, 0 )}.${padLeft ( date.getMilliseconds (), 3, 0 )}]`;
group ( `${name} ${timestamp}` );
const {state} = store;
if ( options.logStateDiffChanges ) {
const {detailedDiff} = require ( 'deep-object-diff' ),
{added, updated, deleted} = detailedDiff ( prevState, state ) as any; //TSC
if ( !isEmptyObject ( added ) ) {
console.log ( 'Added\n ', added );
}
if ( !isEmptyObject ( updated ) ) {
console.log ( 'Updated\n ', updated );
}
if ( !isEmptyObject ( deleted ) ) {
console.log ( 'Deleted\n ', deleted );
}
}
if ( options.logStateFullChanges && !areShallowEqual ( state, prevState ) ) {
export default async (ctx, next) => {
const { namespace, getState } = ctx.store;
const { name: actionName } = ctx.action;
const preState = clone(getState());
const value = await next();
const state = clone(getState());
const diff: any = detailedDiff(preState, state);
const hasChanges = obj => Object.keys(obj).length > 0;
console.group('Store Name: ', namespace);
console.log('Action Name: ', actionName);
if (hasChanges(diff.added)) {
console.log('Added\n', diff.added);
}
if (hasChanges(diff.updated)) {
console.log('Updated\n', diff.updated);
}
if (hasChanges(diff.deleted)) {
console.log('Deleted\n', diff.deleted);
}
container.subscribe(() => {
if (!(UNSTATED.isEnabled && UNSTATED.logStateChanges)) {
return;
}
const {state} = container;
const diff = detailedDiff(prevState, state);
const group = UNSTATED.isCollapsed ? console.groupCollapsed : console.group;
group(name);
const hasChanges = obj => Object.keys(obj).length > 0;
if (hasChanges(diff.added)) {
console.log('Added\n', diff.added);
}
if (hasChanges(diff.updated)) {
console.log('Updated\n', diff.updated);
}
if (hasChanges(diff.deleted)) {
console.log('Deleted\n', diff.deleted);
() => {
const styles = {};
const portalRoot = get(this.portal, 'childNodes[0].childNodes[0]');
if (portalRoot) {
updateChildren(portalRoot);
buildStyleMap(styles, portalRoot);
this.diffs = detailedDiff(this.portalMap, styles);
this.lastPortalMap = this.portalMap;
this.portalMap = styles;
if (this.mounted) {
this.setState(
{
renderedChildren: this.props.children
},
() => {
this.forceUpdate();
}
);
}
}
}
);