machinepack-json
Advanced tools
Comparing version
@@ -41,4 +41,8 @@ module.exports = { | ||
var util = require('util'); | ||
// Backwards compat for Node v0.10 (which doesn't have `util.is*()` qualifiers) | ||
var isFunction = require('lodash.isfunction'); | ||
var isRegExp = require('lodash.isregexp'); | ||
var isError = require('lodash.iserror'); | ||
/** | ||
@@ -71,9 +75,9 @@ * This was modified by @mikermcneil from @isaacs' json-stringify-safe | ||
// Do some advanced serialization | ||
if (util.isError(value)){ | ||
if (isError(value)){ | ||
value = value.stack; | ||
} | ||
else if (util.isRegExp(value)){ | ||
else if (isRegExp(value)){ | ||
value = value.toString(); | ||
} | ||
else if (util.isFunction(value)){ | ||
else if (isFunction(value)){ | ||
value = value.toString(); | ||
@@ -80,0 +84,0 @@ } |
{ | ||
"name": "machinepack-json", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Encode and decode data to and from JSON.", | ||
@@ -16,2 +16,5 @@ "scripts": { | ||
"dependencies": { | ||
"lodash.iserror": "3.1.1", | ||
"lodash.isfunction": "3.0.8", | ||
"lodash.isregexp": "3.0.5", | ||
"machine": "~12.1.0" | ||
@@ -18,0 +21,0 @@ }, |
13556
2.09%434
0.7%4
300%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added