little-state-machine
Advanced tools
Comparing version 2.4.0-beta.2 to 2.4.0-beta.3
@@ -70,3 +70,3 @@ import * as React from 'react'; | ||
if (debug) { | ||
console.log('┌--------------------------'); | ||
console.log('┌─────────────────────────────────────────────────────────────────'); | ||
console.log(`├─%c${key ? options.debugName[key] : options.debugName}`, 'color: #bada55'); | ||
@@ -87,3 +87,5 @@ console.log('├─before:', copy); | ||
const isEmpty = require('lodash.isempty'); | ||
console.log('├─after:', get()); | ||
const diff = difference(get(), copy); | ||
const noChange = isEmpty(diff); | ||
console.log(noChange ? '└─after' : '├─after:', get()); | ||
function difference(object, base) { | ||
@@ -102,5 +104,4 @@ function changes(object, base) { | ||
} | ||
const diff = difference(get(), copy); | ||
if (!isEmpty(diff)) { | ||
console.log('└─diff:', difference(get(), copy)); | ||
if (!noChange(diff)) { | ||
console.log('└─diff:', difference(copy, get()), ' → ', difference(get(), copy)); | ||
} | ||
@@ -107,0 +108,0 @@ } |
@@ -73,3 +73,3 @@ 'use strict'; | ||
if (debug) { | ||
console.log('┌--------------------------'); | ||
console.log('┌─────────────────────────────────────────────────────────────────'); | ||
console.log(`├─%c${key ? options.debugName[key] : options.debugName}`, 'color: #bada55'); | ||
@@ -90,3 +90,5 @@ console.log('├─before:', copy); | ||
const isEmpty = require('lodash.isempty'); | ||
console.log('├─after:', get()); | ||
const diff = difference(get(), copy); | ||
const noChange = isEmpty(diff); | ||
console.log(noChange ? '└─after' : '├─after:', get()); | ||
function difference(object, base) { | ||
@@ -105,5 +107,4 @@ function changes(object, base) { | ||
} | ||
const diff = difference(get(), copy); | ||
if (!isEmpty(diff)) { | ||
console.log('└─diff:', difference(get(), copy)); | ||
if (!noChange(diff)) { | ||
console.log('└─diff:', difference(copy, get()), ' → ', difference(get(), copy)); | ||
} | ||
@@ -110,0 +111,0 @@ } |
{ | ||
"name": "little-state-machine", | ||
"version": "2.4.0-beta.2", | ||
"version": "2.4.0-beta.3", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.es.js", |
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
18344
288843
342