New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

string-function-exec

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-function-exec - npm Package Compare versions

Comparing version 0.5.9 to 0.5.10

2

package.json

@@ -43,3 +43,3 @@ {

},
"version": "0.5.9"
"version": "0.5.10"
}

@@ -131,58 +131,2 @@ 'use strict';

module.exports = StringFunction;
var StringFunction = require('string-function-exec');
// A string containing "regular" javascript function to be executed
var fn1_s = "function f(alias, args) { return alias + \" \" + JSON.stringify(args); }";
/*var sf1_obj = */new StringFunction(fn1_s).exec("fn1",[1,2,3]).then(console.log, console.error);
// A string containing "regular" javascript function containing "anonymous" and "arrow" functions
var fn2_s = "function f(alias, args) { var f1 = function (t_param1) { return t_param1; }; \
var f2 = (t_param2, t_args) => { return t_param2 + \" \" + t_args; }; \
return f1(alias) + \" \" + f2(alias, args) + \" \" + JSON.stringify(args); }";
/*var sf2_obj = */new StringFunction(fn2_s).exec("fn2",[10,20,30]).then(console.log, console.error);
// A string containing "anonymous" javascript function to be executed
var fn3_s = "function (alias, args) { return alias.toString() + \" \" + JSON.stringify(args); }";
/*var sf3_obj = */new StringFunction(fn3_s).exec("fn3",[100,200,300]).then(console.log, console.error);
// A string containing "arrow" javascript function to be executed
var fn4_s = "(alias, args)=>{ return alias.toString() + \" \" + JSON.stringify(args); }";
/*var sf4_obj = */new StringFunction(fn4_s).exec("fn4",[1000,2000,3000]).then(console.log, console.error);
// A string containing two nested "arrow" javascript function to be executed
var fn5_s = "(alias, args) => { var f1 = (p1, p2)=>{ return p1 + \" \" + JSON.stringify(p2); }; return f1(alias, args);}";
/*var sf5_obj = */new StringFunction(fn5_s).exec("fn5",[10000,20000,30000]).then(console.log, console.error);
// A string containing "regular" javascript function to be executed
var fn1_s = "function f(alias, args) { return alias + \" \" + JSON.stringify(args); }";
console.log(new StringFunction(fn1_s, 1).exec("fn1",[1,2,3]));
// A string containing "regular" javascript function containing "anonymous" and "arrow" functions
var fn2_s = "function f(alias, args) { var f1 = function (t_param1) { return t_param1; }; \
var f2 = (t_param2, t_args) => { return t_param2 + \" \" + t_args; }; \
return f1(alias) + \" \" + f2(alias, args) + \" \" + JSON.stringify(args); }";
console.log(new StringFunction(fn2_s, 1).exec("fn2",[10,20,30]));
// A string containing "anonymous" javascript function to be executed
var fn3_s = "function (alias, args) { return alias.toString() + \" \" + JSON.stringify(args); }";
console.log(new StringFunction(fn3_s, 1).exec("fn3",[100,200,300]));
// A string containing "arrow" javascript function to be executed
var fn4_s = "(alias, args)=>{ return alias.toString() + \" \" + JSON.stringify(args); }";
console.log(new StringFunction(fn4_s, 1).exec("fn4",[1000,2000,3000]));
// A string containing two nested "arrow" javascript function to be executed
var fn5_s = "(alias, args) => { var f1 = (p1, p2)=>{ return p1 + \" \" + JSON.stringify(p2); }; return f1(alias, args);}";
console.log(new StringFunction(fn5_s, 1).exec("fn5",[10000,20000,30000]));
module.exports = StringFunction;
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