<commit_before>//
// Xcore
// Copyright © 2021 Xcore
// MIT license, see LICENSE file for details
//

import Foundation

// MARK: - Namespace

/// A namespace for types that serve as feature flags.
///
/// The various feature flags defined as extensions on ``FeatureFlag`` implement
/// their functionality as classes or structures that extend this enumeration.
/// For example, the **System Alert** flag returns a `SystemAlertConfiguration`
/// instance.
public enum FeatureFlags {
    public typealias Key = FeatureFlag.Key
}

// MARK: - Flags

extension FeatureFlags {
    /// Returns a system alert configuration (e.g., **Unsupported App Version**).
    public static func systemAlertConfiguration(key: Key = "system_alert_configuration") -> SystemAlertConfiguration? {
        guard let alert = key.value(SystemAlertConfiguration.self) else {
            return nil
        }

        // Supress the alert if we have already displayed it in this session.
        if alert.isDismissed {
            return nil
        }

        return alert
    }
}<commit_msg>Updated method<commit_after>//
// Xcore
// Copyright © 2021 Xcore
// MIT license, see LICENSE file for details
//

import Foundation

// MARK: - Namespace

/// A namespace for types that serve as feature flags.
///
/// The various feature flags defined as extensions on ``FeatureFlag`` implement
/// their functionality as classes or structures that extend this enumeration.
/// For example, the **System Alert** flag returns a `SystemAlertConfiguration`
/// instance.
public enum FeatureFlags {
    public typealias Key = FeatureFlag.Key
}

// MARK: - Flags

extension FeatureFlags {
    /// Returns a system alert configuration (e.g., **Unsupported App Version**).
    public static func systemAlertConfiguration(key: Key = "system_alert_configuration") -> SystemAlertConfiguration? {
        guard let alert = key.decodedValue(SystemAlertConfiguration.self) else {
            return nil
        }

        // Supress the alert if we have already displayed it in this session.
        if alert.isDismissed {
            return nil
        }

        return alert
    }
}
{'fraction_non_alphanumeric': 0.09167446211412535, 'fraction_numerical': 0.0037418147801683817, 'mean_word_length': 2.765845070422535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1370743', 'n_tokens_mistral': 536, 'n_tokens_neox': 514, 'n_words': 217}