UNPKG

unleash-server

Version:

Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.

19 lines 611 B
export class FeaturesReadModel { constructor(db) { this.db = db; } async featureExists(parent) { const rows = await this.db('features') .where('name', parent) .andWhere('archived_at', null) .select('name'); return rows.length > 0; } async featuresInTheSameProject(featureA, featureB) { const rows = await this.db('features') .countDistinct('project as count') .whereIn('name', [featureA, featureB]); return Number(rows[0].count) === 1; } } //# sourceMappingURL=features-read-model.js.map