private getMsFmSchemaFeatureFlags()

in libraries/azure-app-configuration-importer/src/internal/parsers/defaultConfigurationSettingsConverter.ts [413:427]


  private getMsFmSchemaFeatureFlags(config: object): Array<{ [key: string]: any }>{
    const msFeatureManagementKeyWord = Constants.FeatureManagementKeyWords[3];
    const featureManagementKey =  msFeatureManagementKeyWord as keyof object;
    const featureManagementSection = config[featureManagementKey];

    if (typeof featureManagementSection !== "object") {
      throw new ArgumentError(`The ${msFeatureManagementKeyWord} section must be an object.`);
    }

    if (!Array.isArray(featureManagementSection[Constants.FeatureFlagsKeyWord])) {
      throw new ArgumentError(`The ${Constants.FeatureFlagsKeyWord} key within ${msFeatureManagementKeyWord} must be an array.`);
    }

    return featureManagementSection[Constants.FeatureFlagsKeyWord];
  }