Since the current trend is to reduce the number of lines of code, the right decision would be to reduce the checks for functions or regular code.
It's simple:
$ npm i module-defender
Next step:
const { typeDefend, emptyDefend, notMatchDefend } = require('module-defender');
// Your code
- Simple.
- Minimalistic.
- Useful.