1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/test/fixtures/fake-tag-type-store.js
Ivar Conradi Østhus 17c8fe7710 feat: Introduce addon framework
fixes: #587

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2021-02-05 15:20:00 +01:00

18 lines
479 B
JavaScript

const NotFoundError = require('../../lib/error/notfound-error');
module.exports = () => {
const _tagTypes = {};
return {
getTagType: async name => {
const tag = _tagTypes[name];
if (tag) {
return Promise.resolve(tag);
}
return Promise.reject(new NotFoundError('Could not find tag type'));
},
createTagType: async tag => {
_tagTypes[tag.name] = tag;
},
};
};