mentie 0.2.35 → 0.2.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/modules/cache.js +1 -1
- package/modules/logging.js +3 -1
- package/modules/validations.js +3 -1
- package/package.json +1 -1
package/modules/cache.js
CHANGED
|
@@ -24,7 +24,7 @@ export function cache( key, value ) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// Warn if the key contains 'undefined'
|
|
27
|
-
if( key
|
|
27
|
+
if( `${ key }`.includes( 'undefined' ) ) {
|
|
28
28
|
log.warn( `The cache key ${ key } contains 'undefined', this may indicate a bug in your cache logic` )
|
|
29
29
|
}
|
|
30
30
|
|
package/modules/logging.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import stringify from "safe-stable-stringify"
|
|
2
|
+
|
|
1
3
|
// Import environment data
|
|
2
4
|
import { dev, env } from "./environment.js"
|
|
3
5
|
|
|
@@ -68,7 +70,7 @@ const annotate_messages = messages => {
|
|
|
68
70
|
if( env.is_cypress() ) {
|
|
69
71
|
|
|
70
72
|
try {
|
|
71
|
-
messages = messages.map( message =>
|
|
73
|
+
messages = messages.map( message => stringify( message, null, 2 ) )
|
|
72
74
|
} catch {
|
|
73
75
|
// This fails if the JSON was something curcular, se we'll leave things as they are
|
|
74
76
|
}
|
package/modules/validations.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import stringify from "safe-stable-stringify"
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Regular expression for validating email addresses.
|
|
3
5
|
* @see {@link https://emailregex.com/}
|
|
@@ -82,7 +84,7 @@ export const shallow_compare_objects = ( obj1={}, obj2={}, include_originals=fal
|
|
|
82
84
|
const changes = keys.reduce( ( acc, key ) => {
|
|
83
85
|
|
|
84
86
|
// Check if the key is in both objects
|
|
85
|
-
if(
|
|
87
|
+
if( stringify( obj1[ key ] ) === stringify( obj2[ key ] ) ) return acc
|
|
86
88
|
|
|
87
89
|
// Generate from/to object
|
|
88
90
|
const changes = { from: obj1[ key ], to: obj2[ key ] }
|