CIA Compliance Manager API Documentation - v1.0.1
    Preparing search index...
    • Check if a string is a valid security level

      Type guard function that validates whether a value is a valid SecurityLevel. Useful for runtime type checking and validation of user input or API responses.

      Parameters

      • value: unknown

        Value to check (can be any type)

      Returns value is SecurityLevel

      Type predicate indicating if value is SecurityLevel

      if (isSecurityLevel(userInput)) {
      // TypeScript knows userInput is SecurityLevel here
      const level: SecurityLevel = userInput;
      console.log(`Valid security level: ${level}`);
      }

      isSecurityLevel('High') // true
      isSecurityLevel('Invalid') // false
      isSecurityLevel(123) // false
      isSecurityLevel(null) // false