toToggleState

[ Function ]

public static toToggleState(
    value: string,
    defaultValue: ToggleState | null = null
): ToggleState | null;

Checks if a value is a ToggleState and returns it.

Parameter

Name

Type

Description

value

string

The value to convert.

defaultValue

ToggleState, null

This value is returned if the first parameter is not valid. Null applies if this parameter is not passed.

Return value

Type

Description

ToggleState, null

Returns the appropriate value or null in the event of an error.

toToggleState 1:

Available from 1.8