• Compare two version strings numerically.

    Parameters

    • a: undefined | null | string

      The first version.

    • b: undefined | null | string

      The second version.

    Returns number

    -1 if a < b, 1 if a > b, 0 if they are equal (ignoring zero-padding differences and any pre-release / build suffix).