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

    Variable isSecurityLevel

    isSecurityLevel: (value: unknown) => value is SecurityLevel

    Type Declaration

      • (value: unknown): value is SecurityLevel
      • 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