Conditional check on module.exports