Socket
Socket
Sign inDemoInstall

cross-safe-eval

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.0.2

3

index.js

@@ -0,4 +1,5 @@

var globalScope = global ? global : window // node.js and browser
var globals = Object.getOwnPropertyNames(globalScope)
module.exports = function makeSafeEval (include) {
var globals = Object.getOwnPropertyNames(this)
var clearGlobals = ''

@@ -5,0 +6,0 @@ for (var i = 0, len = globals.length; i < len; i++) {

{
"name": "cross-safe-eval",
"version": "0.0.1",
"version": "0.0.2",
"description": "Node.js and browser 8 lines implementation of a safe eval",

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

@@ -14,3 +14,3 @@ var test = require('tape')

t.plan(8)
t.plan(10)

@@ -34,2 +34,13 @@ var safeEval1 = makeSafeEval()

var fn = function () {
this.method = function () {
var safeEval3 = makeSafeEval()
t.equal(ignoreErrors(() => safeEval3('window')), undefined, 'should have no access to local this')
t.equal(ignoreErrors(() => safeEval3('console')), undefined, 'should have no access to local this')
}
}
a = new fn()
a.method()
})
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc