I'm relatively new to JavaScript and I'm running into an issue where I am trying to call a function from a file where it is also being exported. How do I call this function? It's important that I am able to call this function from this file as well as export it for other uses. Thanks a ton for help on this!
I have added the relevant code below:
module.exports.handleCreatedTs = function(criteria, newSearch){
...Lots of Calculations happen here...
}
module.exports.handleDateAndTermsDueDate = function(criteria, newSearch, isTermsDueDate){
var tempSearchObj = {};
handleCreatedTs(criteria, tempSearchObj); //This is where the exception is thrown
if(isTermsDueDate){
newSearch.termsDueDate = tempSearchObj;
}
else{
newSearch.date = tempSearchObj;
}
}
module.exports.handleInvoiceSupplierName = function(criteria, newSearch){
if(criteria.operator != "equals"){
return; //Not going to handle this
}
newSearch.supplierOrg.push({text: criteria.value, value: criteria.value});
}