mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
21 lines
524 B
JavaScript
21 lines
524 B
JavaScript
|
var _ = require('lodash'),
|
||
|
api = require('../api'),
|
||
|
flagIsSet;
|
||
|
|
||
|
flagIsSet = function flagIsSet(flag) {
|
||
|
return api.settings.read({key: 'labs', context: {internal: true}}).then(function (response) {
|
||
|
var labs,
|
||
|
labsValue;
|
||
|
|
||
|
labs = _.find(response.settings, function (setting) {
|
||
|
return setting.key === 'labs';
|
||
|
});
|
||
|
|
||
|
labsValue = JSON.parse(labs.value);
|
||
|
|
||
|
return !!labsValue[flag] && labsValue[flag] === true;
|
||
|
});
|
||
|
};
|
||
|
|
||
|
module.exports.isSet = flagIsSet;
|