Function valueWithDefault

Returns a value if it exists, otherwise returns a default value

  • Type Parameters

    • T

      The type of the value

    Parameters

    • params: {
          defaultValue: T;
          value?: T;
      }

      Configuration object

      • defaultValue: T

        The default value to return if value is null/undefined

      • Optionalvalue?: T

        The value to check (optional)

    Returns T

    The value if it exists, otherwise the default value