Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-retrieve-globals

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-retrieve-globals - npm Package Compare versions

Comparing version 2.0.7 to 2.0.8

2

package.json
{
"name": "node-retrieve-globals",
"version": "2.0.7",
"version": "2.0.8",
"description": "Execute a string of JavaScript using Node.js and return the global variable values and functions.",

@@ -5,0 +5,0 @@ "type": "module",

@@ -18,3 +18,3 @@ import test from "ava";

};
let vm = new RetrieveGlobals("var a = 1;");

@@ -33,3 +33,3 @@ t.true(isPlainObject(vm.getGlobalContextSync()));

};
let vm = new RetrieveGlobals("var a = { b: 1, c: { d: {} } };");

@@ -41,3 +41,23 @@ let obj = vm.getGlobalContextSync();

test("isPlainObject deep circular", t => {
// from eleventy-utils
function isPlainObject(value) {
if (value === null || typeof value !== "object") {
return false;
}
let proto = Object.getPrototypeOf(value);
return !proto || proto === Object.prototype;
};
let vm = new RetrieveGlobals(`
var a = { a: 1 };
var b = { b: a };
a.b = b;
`);
let obj = vm.getGlobalContextSync();
t.true(isPlainObject(obj.a.b));
t.true(isPlainObject(obj.b.b));
});
test("var with data", t => {

@@ -44,0 +64,0 @@ let vm = new RetrieveGlobals("var a = b;");

Sorry, the diff of this file is not supported yet

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