So I'm trying to run a few checks inside a file. Lets say inside checks.js
I have
module.exports = async (content) => {
// Check no.1
if (content.id != 'SomeID') return;
// Check no.2
if (content.length > 20) return;
//..etc
}
And in my main file I am requiring this file. I want it to return in the original file depending on the outcome of checks.js
So lets say the content id isn't the same as 'SomeID', I want it to return and not to continue the rest of the code in my main file. I did require('filePath')(content)
But it doesn't actually return in the main file as it should by instructions in checks.js
What am I doing wrong and what should I be doing. Thank you in advance!