little-state-machine
Advanced tools
Comparing version 2.4.0-beta.1 to 2.4.0-beta.2
@@ -70,3 +70,4 @@ import * as React from 'react'; | ||
if (debug) { | ||
console.log(`%c${key ? options.debugName[key] : options.debugName}`, 'color: #bada55'); | ||
console.log('┌--------------------------'); | ||
console.log(`├─%c${key ? options.debugName[key] : options.debugName}`, 'color: #bada55'); | ||
console.log('├─before:', copy); | ||
@@ -82,7 +83,8 @@ } | ||
if (debug) { | ||
const transform = require('lodash.transform'); | ||
const isEqual = require('lodash.isequal'); | ||
const isObject = require('lodash.isobject'); | ||
const isEmpty = require('lodash.isempty'); | ||
console.log('├─after:', get()); | ||
function difference(object, base) { | ||
const transform = require('lodash.transform'); | ||
const isEqual = require('lodash.isequal'); | ||
const isObject = require('lodash.isobject'); | ||
function changes(object, base) { | ||
@@ -100,3 +102,6 @@ return transform(object, function (result, value, key) { | ||
} | ||
console.log('└─diff:', difference(copy, get())); | ||
const diff = difference(get(), copy); | ||
if (!isEmpty(diff)) { | ||
console.log('└─diff:', difference(get(), copy)); | ||
} | ||
} | ||
@@ -113,3 +118,3 @@ } | ||
window.LITTLE_STATE_MACHINE_DEBUG = (value) => { | ||
storageType.setItem(STATE_MACHINE_DEBUG_NAME, value); | ||
storageType.setItem(getName(), value); | ||
}; | ||
@@ -120,2 +125,6 @@ // @ts-ignore | ||
}; | ||
// @ts-ignore | ||
window.LITTLE_STATE_MACHINE_GET = () => { | ||
storageType.getItem(getName()); | ||
}; | ||
} | ||
@@ -122,0 +131,0 @@ if (callbacks && Object.keys(callbacks).length) { |
@@ -73,3 +73,4 @@ 'use strict'; | ||
if (debug) { | ||
console.log(`%c${key ? options.debugName[key] : options.debugName}`, 'color: #bada55'); | ||
console.log('┌--------------------------'); | ||
console.log(`├─%c${key ? options.debugName[key] : options.debugName}`, 'color: #bada55'); | ||
console.log('├─before:', copy); | ||
@@ -85,7 +86,8 @@ } | ||
if (debug) { | ||
const transform = require('lodash.transform'); | ||
const isEqual = require('lodash.isequal'); | ||
const isObject = require('lodash.isobject'); | ||
const isEmpty = require('lodash.isempty'); | ||
console.log('├─after:', get()); | ||
function difference(object, base) { | ||
const transform = require('lodash.transform'); | ||
const isEqual = require('lodash.isequal'); | ||
const isObject = require('lodash.isobject'); | ||
function changes(object, base) { | ||
@@ -103,3 +105,6 @@ return transform(object, function (result, value, key) { | ||
} | ||
console.log('└─diff:', difference(copy, get())); | ||
const diff = difference(get(), copy); | ||
if (!isEmpty(diff)) { | ||
console.log('└─diff:', difference(get(), copy)); | ||
} | ||
} | ||
@@ -116,3 +121,3 @@ } | ||
window.LITTLE_STATE_MACHINE_DEBUG = (value) => { | ||
storageType.setItem(STATE_MACHINE_DEBUG_NAME, value); | ||
storageType.setItem(getName(), value); | ||
}; | ||
@@ -123,2 +128,6 @@ // @ts-ignore | ||
}; | ||
// @ts-ignore | ||
window.LITTLE_STATE_MACHINE_GET = () => { | ||
storageType.getItem(getName()); | ||
}; | ||
} | ||
@@ -125,0 +134,0 @@ if (callbacks && Object.keys(callbacks).length) { |
{ | ||
"name": "little-state-machine", | ||
"version": "2.4.0-beta.1", | ||
"version": "2.4.0-beta.2", | ||
"main": "dist/index.js", | ||
@@ -51,2 +51,3 @@ "module": "dist/index.es.js", | ||
"lodash.clonedeep": "^4.5.0", | ||
"lodash.isempty": "^4.4.0", | ||
"lodash.isequal": "^4.5.0", | ||
@@ -53,0 +54,0 @@ "lodash.isobject": "^3.0.2", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17792
7
7
340
+ Addedlodash.isempty@^4.4.0
+ Addedlodash.isempty@4.4.0(transitive)