functor[false] = (req, res, next) => {...}
?class Checker{
static get checkFn() {
return functor[process.env.NODE_ENV === 'user']
}
}
const functor = []
functor[true] = (req, res, next) => {...}
functor[false] = (req, res, next) => {...}
app.use('/api/users', Checker.checkFn, users)
var functor = {};