yves 1.0.82 → 1.0.84

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/dist/yves.js CHANGED
@@ -3441,7 +3441,7 @@ function stringify(obj, options) {
3441
3441
  case "null" : return stylize("null", 'special');
3442
3442
  case "undefined": return stylize("undefined", 'special');
3443
3443
  case "boolean" : return stylize(obj + '', 'bool');
3444
- case "date" : return stylize('new Date("'+obj.toUTCString()+'")','date');
3444
+ case "date" : return stylize('new Date("'+obj.toISOString()+'")','date');
3445
3445
  case "array" : return stringifyArray(obj, options, stack.length);
3446
3446
  case "object" : return stringifyObject(obj, options, stack.length);
3447
3447
  }
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,7 @@ 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
+ obj = jsonc.parse(jsonc.stringify(obj))
296
298
  options = merge(this.defaults, options || {});
297
299
  stack = [];
298
300
  seenObjects = []
@@ -408,7 +410,7 @@ function stringify(obj, options) {
408
410
  case "null" : return stylize("null", 'special');
409
411
  case "undefined": return stylize("undefined", 'special');
410
412
  case "boolean" : return stylize(obj + '', 'bool');
411
- case "date" : return stylize('new Date("'+obj.toUTCString()+'")','date');
413
+ case "date" : return stylize('new Date("'+obj.toISOString()+'")','date');
412
414
  case "array" : return stringifyArray(obj, options, stack.length);
413
415
  case "object" : return stringifyObject(obj, options, stack.length);
414
416
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yves",
3
- "version": "1.0.82",
3
+ "version": "1.0.84",
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)