diff --git a/lib/global_config.js b/lib/global_config.js index ea3775c2c..ce347eea9 100644 --- a/lib/global_config.js +++ b/lib/global_config.js @@ -9,11 +9,8 @@ const mkdirp = require('mkdirp'); const Util = require('./util'); const Errors = require('./errors'); const Logger = require('./logger'); -const vm = require('vm'); const { XMLParser, XMLValidator } = require("fast-xml-parser"); -const VM_CONTEXT = vm.createContext() // create a new context so VM does not have to make a new one for each conversion - let insecureConnect = false; /** @@ -173,7 +170,7 @@ const rest = { exports.rest = rest; // The default JSON parser -exports.jsonColumnVariantParser = rawColumnValue => vm.runInContext("(" + rawColumnValue + ")", VM_CONTEXT); +exports.jsonColumnVariantParser = rawColumnValue => new Function(`return (${rawColumnValue});`)(); /** * Updates the value of the 'jsonColumnVariantParser' parameter.