@salesforce/ts-types
    Preparing search index...

    Function asBoolean

    • Narrows an unknown value to a boolean if it is type-compatible, or returns undefined otherwise.

      Parameters

      • value: unknown

        The value to test.

      Returns Optional<boolean>

    • Narrows an unknown value to a boolean if it is type-compatible, or returns the provided default otherwise.

      Parameters

      • value: unknown

        The value to test.

      • defaultValue: boolean

        The default to return if value was undefined or of the incorrect type.

      Returns boolean