• Returns a Duration object from param duration when it is a number, otherwise return itself

    Parameters

    • duration: undefined | number | Duration

      = number to be converted to a Duration or Duration object

    • unit: Unit = Duration.Unit.MILLISECONDS

      = (Default Duration.Unit.MILLISECONDS) Duration unit of number - See

    Returns Duration

    for valid values