javascript-stringify
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -50,22 +50,6 @@ (function (root, stringify) { | ||
*/ | ||
var getGlobalVariable = function () { | ||
return 'global'; | ||
var getGlobalVariable = function (value, indent, stringify) { | ||
return 'Function(' + stringify('return this;') + ')()'; | ||
}; | ||
/* istanbul ignore next */ | ||
if (typeof window === 'object' && typeof window.document === 'object') { | ||
// Support browser environments. | ||
getGlobalVariable = function () { | ||
return 'window'; | ||
}; | ||
} | ||
/* istanbul ignore next */ | ||
if (typeof self === 'object' && typeof self.importScripts === 'function') { | ||
// Support web worker environments. | ||
getGlobalVariable = function () { | ||
return 'self'; | ||
}; | ||
} | ||
/** | ||
@@ -72,0 +56,0 @@ * Convert JavaScript objects into strings. |
{ | ||
"name": "javascript-stringify", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Stringify is to `eval` as `JSON.stringify` is to `JSON.parse`", | ||
@@ -5,0 +5,0 @@ "main": "javascript-stringify.js", |
@@ -17,3 +17,2 @@ var expect = require('chai').expect; | ||
it('object', test({ key: 'value', '-': 10 }, '{key:\'value\',\'-\':10}')); | ||
it('global', test(global, 'global')); | ||
@@ -28,2 +27,6 @@ it('NaN', test(NaN, 'NaN')); | ||
it('Boolean', test(new Boolean(true), 'new Boolean(true)')); | ||
it('global', function () { | ||
expect(eval(stringify(global))).to.equal(global); | ||
}); | ||
}); | ||
@@ -30,0 +33,0 @@ |
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
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
14068
299
1