yves 1.0.83 → 1.0.85

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/lib/yves.js CHANGED
@@ -22,6 +22,7 @@ function isItA(obj,A) {
22
22
  var sortobject = require('deep-sort-object');
23
23
  var supportsColor = require('supports-color')
24
24
  var debug = require('debug');
25
+ var jsonc = require('jsonc');
25
26
  var stack = [];
26
27
 
27
28
  var verbose = false;
@@ -293,6 +294,10 @@ seenObjects = []
293
294
  // If we have a `stream` defined, use it to print a styled string,
294
295
  // if not, we just return the stringified object.
295
296
  yves.inspect = function (obj, label, options) {
297
+ const str = jsonc.stringify(obj)
298
+ if (str) {
299
+ obj = jsonc.parse(str)
300
+ }
296
301
  options = merge(this.defaults, options || {});
297
302
  stack = [];
298
303
  seenObjects = []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yves",
3
- "version": "1.0.83",
3
+ "version": "1.0.85",
4
4
  "description": "a customizable value inspector",
5
5
  "url": "http://github.com/jorisroling/yves",
6
6
  "repository": {
@@ -41,6 +41,7 @@
41
41
  "dependencies": {
42
42
  "debug": "^4.3.4",
43
43
  "deep-sort-object": "^1.0.2",
44
+ "jsonc": "^2.0.0",
44
45
  "pkginfo": "^0.4.1",
45
46
  "supports-color": "^8.1.1"
46
47
  },
package/test/yves-test.js CHANGED
@@ -172,7 +172,7 @@ yves.inspect({
172
172
  }, "html",{html: true});
173
173
 
174
174
 
175
- var buf = new Buffer("joris is gek")
175
+ var buf = new Buffer.from("joris is gek")
176
176
  yves.inspect({
177
177
  date: new Date(),
178
178
  buffer: buf,
@@ -209,3 +209,9 @@ console.log('world')
209
209
 
210
210
  console.dir({joris:'gek'})
211
211
 
212
+ let objA = {a:1,b:2}
213
+ objA.c=objA
214
+
215
+ console.log(objA)
216
+
217
+ yves.inspect(objA)