Ghost/core/server/web/shared/middlewares/labs.js
Hannah Wolfe 4f5fb3d820 Swapped common for @tryghost/errors in core/server/web
- Update all references to common.errors to use @tryghost/errors
- Use dereferencing to only require used bits of common in each file
2020-04-09 19:40:00 +01:00

15 lines
332 B
JavaScript

const errors = require('@tryghost/errors');
const labsUtil = require('../../../services/labs');
const labs = flag => (req, res, next) => {
if (labsUtil.isSet(flag) === true) {
return next();
} else {
return next(new errors.NotFoundError());
}
};
labs.members = labs('members');
module.exports = labs;