asarfuckery/appasar/development/common/FeatureFlags.js

29 lines
542 B
JavaScript
Raw Normal View History

2019-01-17 18:22:05 +00:00
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
class FeatureFlags {
constructor() {
this.flags = new Set();
}
getSupported() {
return Array.from(this.flags);
}
supports(feature) {
return this.flags.has(feature);
}
declareSupported(feature) {
if (this.supports(feature)) {
console.error('Feature redeclared; is this a duplicate flag? ', feature);
return;
}
this.flags.add(feature);
}
}
exports.default = FeatureFlags;
module.exports = exports['default'];