Revert "Moved labs middleware into labs utility"

This reverts commit 161ba51d2b.
This commit is contained in:
Hannah Wolfe 2021-07-08 07:09:06 +01:00
parent 161ba51d2b
commit 145762485e
No known key found for this signature in database
GPG Key ID: 9F8C7532D0A6BA55
2 changed files with 12 additions and 8 deletions

View File

@ -0,0 +1,12 @@
const errors = require('@tryghost/errors');
const labsUtil = require('../../../../shared/labs');
const labs = flag => (req, res, next) => {
if (labsUtil.isSet(flag) === true) {
return next();
} else {
return next(new errors.NotFoundError());
}
};
module.exports = labs;

View File

@ -94,11 +94,3 @@ module.exports.enabledHelper = function enabledHelper(options, callback) {
return errString;
};
module.exports.enabledMiddleware = flag => (req, res, next) => {
if (this.isSet(flag) === true) {
return next();
} else {
return next(new errors.NotFoundError());
}
};