{"version":3,"file":"features.mjs","sources":["../../src/services/features.ts"],"sourcesContent":["/**\n * The features service is responsible for managing features within strapi,\n * including interacting with the feature configuration file to know\n * which are enabled and disabled.\n */\n\nimport type { Strapi, FeaturesService, FeaturesConfig } from '@strapi/types';\n\ntype FeatureName = keyof FeaturesConfig['future'];\n\nconst createFeaturesService = (strapi: Strapi): FeaturesService => {\n  const service: FeaturesService = {\n    get config() {\n      return strapi.config.get<FeaturesService['config']>('features');\n    },\n    future: {\n      isEnabled(futureFlagName: string): boolean {\n        return service.config?.future?.[futureFlagName as FeatureName] === true;\n      },\n    },\n  };\n\n  return service;\n};\n\nexport { createFeaturesService };\nexport type { FeaturesService };\n"],"names":[],"mappings":"AAUM,MAAA,wBAAwB,CAAC,WAAoC;AACjE,QAAM,UAA2B;AAAA,IAC/B,IAAI,SAAS;AACJ,aAAA,OAAO,OAAO,IAA+B,UAAU;AAAA,IAChE;AAAA,IACA,QAAQ;AAAA,MACN,UAAU,gBAAiC;AACzC,eAAO,QAAQ,QAAQ,SAAS,cAA6B,MAAM;AAAA,MACrE;AAAA,IACF;AAAA,EAAA;AAGK,SAAA;AACT;"}