CIA Compliance Manager API Documentation - v1.0.1
    Preparing search index...

    Variable normalizeSecurityLevel

    normalizeSecurityLevel: (level?: string | null) => SecurityLevel

    Type Declaration

      • (level?: string | null): SecurityLevel
      • Normalize any security level input to a valid SecurityLevel enum value

        Handles various input formats including case variations and null/undefined values. Provides a robust way to convert user input or API responses to valid SecurityLevel values.

        Parameters

        • Optionallevel: string | null

          Input that might be a security level (can be string, SecurityLevel, null, or undefined)

        Returns SecurityLevel

        A valid SecurityLevel enum value (defaults to 'Moderate' if invalid)

        normalizeSecurityLevel('high')        // 'High' (case normalization)
        normalizeSecurityLevel('VERY HIGH') // 'Very High' (case normalization)
        normalizeSecurityLevel(null) // 'Moderate' (default)
        normalizeSecurityLevel(undefined) // 'Moderate' (default)
        normalizeSecurityLevel('invalid') // 'Moderate' (default for invalid input)
        normalizeSecurityLevel('High') // 'High' (already valid)