tsParticles - v4.4.0
    Preparing search index...
    • Converts a value to a valid enum member, falling back to the given default when the value is not a member.

      Type Parameters

      • T extends Record<string, string | number>

      Parameters

      • enumObject: T

        the enum object holding the allowed values

      • arg: unknown

        the value to convert

      • defaultValue: T[keyof T]

        the value returned when the argument is not a member of the enum

      Returns T[keyof T]

      the matching enum member or the given default