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

clone-function

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clone-function - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"name": "clone-function",
"version": "1.0.4",
"version": "1.0.5",
"description": "Clones non native JavaScript functions, or references native functions.",

@@ -5,0 +5,0 @@ "main": "./src/clone-function.js",

@@ -17,7 +17,12 @@ /*

function cloneFunction(func) {
var out;
if (/\[native code\]/.test(func.toString())) {
out = func;
} else {
out = eval('(function(){return ' + func.toString() + '}());');
var out, str;
try {
str = func.toString();
if (/\[native code\]/.test(str)) {
out = func;
} else {
out = eval('(function(){return ' + str + '}());');
}
} catch (e) {
throw new Error(e.message + '\r\n\r\n' + str);
}

@@ -24,0 +29,0 @@ return out;

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