Socket
Socket
Sign inDemoInstall

rttc

Package Overview
Dependencies
Maintainers
4
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rttc - npm Package Compare versions

Comparing version 7.0.0 to 7.0.1

87

lib/helpers/sanitize.js

@@ -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);
// };
// }

2

package.json
{
"name": "rttc",
"version": "7.0.0",
"version": "7.0.1",
"description": "Runtime type-checking for JavaScript.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc