mentie 0.2.36 → 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.
@@ -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 => JSON.stringify( message, null, 2 ) )
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
  }
@@ -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( JSON.stringify( obj1[ key ] ) === JSON.stringify( obj2[ key ] ) ) return acc
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 ] }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mentie",
3
- "version": "0.2.36",
3
+ "version": "0.2.37",
4
4
  "description": "Mentor's toolbelt",
5
5
  "type": "module",
6
6
  "main": "index.js",