Comparing version 5.0.0 to 5.0.1
@@ -137,73 +137,73 @@ "use strict"; | ||
if ((0, _isRegex["default"])(value)) { | ||
if (!options.allowRegExp) { | ||
if (typeof value === 'boolean') { | ||
return value; | ||
} | ||
if (value === undefined) { | ||
if (!options.allowUndefined) { | ||
return undefined; | ||
} | ||
return "_regexp_".concat(value.flags, "|").concat(value.source); | ||
return '_undefined_'; | ||
} | ||
if ((0, _isFunction["default"])(value)) { | ||
if (!options.allowFunction) { | ||
return undefined; | ||
if (typeof value === 'number') { | ||
if (value === -Infinity) { | ||
return '_-Infinity_'; | ||
} | ||
var name = value.name; | ||
var stringified = value.toString(); | ||
if (value === Infinity) { | ||
return '_Infinity_'; | ||
} | ||
if (!stringified.match(/(\[native code\]|WEBPACK_IMPORTED_MODULE|__webpack_exports__|__webpack_require__)/)) { | ||
return "_function_".concat(name, "|").concat(cleanCode(convertShorthandMethods(key, stringified))); | ||
if (Number.isNaN(value)) { | ||
return '_NaN_'; | ||
} | ||
return "_function_".concat(name, "|").concat(function () {}.toString()); | ||
return value; | ||
} | ||
if ((0, _isSymbol["default"])(value)) { | ||
if (!options.allowSymbol) { | ||
return undefined; | ||
if (typeof value === 'string') { | ||
if (dateFormat.test(value)) { | ||
if (!options.allowDate) { | ||
return undefined; | ||
} | ||
return "_date_".concat(value); | ||
} | ||
return "_symbol_".concat(value.toString().slice(7, -1)); | ||
return value; | ||
} | ||
if (typeof value === 'string' && dateFormat.test(value)) { | ||
if (!options.allowDate) { | ||
if ((0, _isRegex["default"])(value)) { | ||
if (!options.allowRegExp) { | ||
return undefined; | ||
} | ||
return "_date_".concat(value); | ||
return "_regexp_".concat(value.flags, "|").concat(value.source); | ||
} | ||
if (value === undefined) { | ||
if (!options.allowUndefined) { | ||
if ((0, _isFunction["default"])(value)) { | ||
if (!options.allowFunction) { | ||
return undefined; | ||
} | ||
return '_undefined_'; | ||
} | ||
var name = value.name; | ||
var stringified = value.toString(); | ||
if (typeof value === 'number') { | ||
if (value === -Infinity) { | ||
return '_-Infinity_'; | ||
if (!stringified.match(/(\[native code\]|WEBPACK_IMPORTED_MODULE|__webpack_exports__|__webpack_require__)/)) { | ||
return "_function_".concat(name, "|").concat(cleanCode(convertShorthandMethods(key, stringified))); | ||
} | ||
if (value === Infinity) { | ||
return '_Infinity_'; | ||
} | ||
return "_function_".concat(name, "|").concat(function () {}.toString()); | ||
} | ||
if (Number.isNaN(value)) { | ||
return '_NaN_'; | ||
if ((0, _isSymbol["default"])(value)) { | ||
if (!options.allowSymbol) { | ||
return undefined; | ||
} | ||
return value; | ||
return "_symbol_".concat(value.toString().slice(7, -1)); | ||
} | ||
if (typeof value === 'string') { | ||
return value; | ||
} | ||
if (typeof value === 'boolean') { | ||
return value; | ||
} | ||
if (stack.length >= options.maxDepth) { | ||
@@ -210,0 +210,0 @@ if (Array.isArray(value)) { |
{ | ||
"name": "telejson", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
20617