Lightcord/modules/discord_desktop_core/core/common/FeatureFlags.js

33 lines
568 B
JavaScript
Raw Normal View History

2020-12-12 11:56:28 +01:00
"use strict";
2020-05-16 23:24:51 +02:00
Object.defineProperty(exports, "__esModule", {
value: true
});
2020-12-12 11:56:28 +01:00
exports.default = void 0;
2020-05-16 23:24:51 +02:00
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);
}
2020-12-12 11:56:28 +01:00
2020-05-16 23:24:51 +02:00
}
2020-12-12 11:56:28 +01:00
2020-05-16 23:24:51 +02:00
exports.default = FeatureFlags;
module.exports = exports.default;