Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function (error, data, response) {
try{
var feed = JSON.parse(data);
if(global.debug){
console.log(data);
console.log(optionalParams);
}
outputJSON.positions = feed["json.accountPositionsResponse"];
outputJSON.success=true;
outputJSON.epoch = (new Date).getTime();
outputJSON.runtime = (new Date).getTime() - outputJSON.runtime;
callback(outputJSON);
}
catch(e){
outputJSON.optionalParams = optionalParams;
outputJSON.success=false;
outputJSON.error = accountError.syntaxerror;
if(global.debug){
outputJSON.data= data;
outputJSON.accountId = accountId;
console.log(outputJSON);
};
outputJSON.epoch = (new Date).getTime();