Comparing version 7.0.0 to 7.0.1
@@ -60,8 +60,8 @@ /** | ||
// if (!cycleReplacer) { | ||
var cycleReplacer = function(unused, value) { | ||
if (stack[0] === value) return '[Circular ~]'; | ||
return '[Circular ~.' + keys.slice(0, stack.indexOf(value)).join('.') + ']'; | ||
}; | ||
// } | ||
// This was modified from @isaacs' json-stringify-safe | ||
// (see https://github.com/isaacs/json-stringify-safe/commit/02cfafd45f06d076ac4bf0dd28be6738a07a72f9#diff-c3fcfbed30e93682746088e2ce1a4a24) | ||
var cycleReplacer = function(unused, value) { | ||
if (stack[0] === value) return '[Circular ~]'; | ||
return '[Circular ~.' + keys.slice(0, stack.indexOf(value)).join('.') + ']'; | ||
}; | ||
@@ -118,2 +118,6 @@ function _recursivelyRebuildAndSanitize (val, key) { | ||
} | ||
// Coerce -0 to +0 | ||
else if (val === 0) { | ||
val = 0; | ||
} | ||
} | ||
@@ -142,72 +146,1 @@ else if (_.isObject(val)) { | ||
} | ||
// /** | ||
// * This was modified by @mikermcneil from @isaacs' json-stringify-safe | ||
// * (see https://github.com/isaacs/json-stringify-safe/commit/02cfafd45f06d076ac4bf0dd28be6738a07a72f9#diff-c3fcfbed30e93682746088e2ce1a4a24) | ||
// * @param {===} val [description] | ||
// * @return {String} [description] | ||
// */ | ||
// function stringifySafe(val) { | ||
// return JSON.stringify(val, serializer()); | ||
// } | ||
// function serializer(replacer, cycleReplacer) { | ||
// var stack = []; | ||
// var keys = []; | ||
// if (!cycleReplacer) { | ||
// cycleReplacer = function(key, value) { | ||
// if (stack[0] === value) return '[Circular ~]'; | ||
// return '[Circular ~.' + keys.slice(0, stack.indexOf(value)).join('.') + ']'; | ||
// }; | ||
// } | ||
// return function(key, value) { | ||
// if (stack.length > 0) { | ||
// var thisPos = stack.indexOf(this); | ||
// ~thisPos ? stack.splice(thisPos + 1) : stack.push(this); | ||
// ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key); | ||
// if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value); | ||
// } | ||
// else stack.push(value); | ||
// // Serialize errors, regexps, dates, and functions to strings: | ||
// if (_.isError(value)){ | ||
// value = value.stack; | ||
// } | ||
// else if (_.isRegExp(value)){ | ||
// value = value.toString(); | ||
// } | ||
// else if (_.isFunction(value)){ | ||
// value = value.toString(); | ||
// } | ||
// else if (_.isObject(value)){ | ||
// if (value instanceof Readable) { | ||
// return null; | ||
// } | ||
// if (value instanceof Buffer) { | ||
// return null; | ||
// } | ||
// } | ||
// // Coerce NaN, Infinity, and -Infinity to 0: | ||
// if (_.isNaN(value)) { | ||
// value = 0; | ||
// } | ||
// else if (value === Infinity) { | ||
// value = 0; | ||
// } | ||
// else if (value === -Infinity) { | ||
// value = 0; | ||
// } | ||
// if (!replacer) { | ||
// return value; | ||
// } | ||
// return replacer.call(this, key, value); | ||
// }; | ||
// } |
{ | ||
"name": "rttc", | ||
"version": "7.0.0", | ||
"version": "7.0.1", | ||
"description": "Runtime type-checking for JavaScript.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
164942
3357