mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
29 lines
624 B
JavaScript
29 lines
624 B
JavaScript
var Promise = require('bluebird');
|
|
var featuresMock = require('./featuresMock');
|
|
// var dbPool = require('./dbPool');
|
|
|
|
function getFeature(name) {
|
|
var featureFound;
|
|
featuresMock.forEach(function (feature) {
|
|
if (feature.name === name) {
|
|
featureFound = feature;
|
|
}
|
|
});
|
|
|
|
return Promise.resolve(featureFound);
|
|
}
|
|
|
|
function getFeatures() {
|
|
return Promise.resolve(featuresMock);
|
|
}
|
|
|
|
function addFeature(feature) {
|
|
featuresMock.push(feature);
|
|
return Promise.resolve();
|
|
}
|
|
|
|
module.exports = {
|
|
getFeature: getFeature,
|
|
getFeatures: getFeatures,
|
|
addFeature: addFeature
|
|
}; |