• Example

    compare('10.1.8', '10.0.4', '>') // true
    compare('10.0.1', '10.0.1', '=') // true
    compare('10.1.1', '10.2.2', '<') // true
    compare('10.1.1', '10.2.2', '<=') // true
    compare('10.1.1', '10.2.2', '>=') // false

    Returns

    Whether the semantic versioning of v1 and v2 compared via an operator is valid.

    Parameters

    • v1: string

      The first semantic version to compare.

    • v2: string

      The second semantic version to compare.

    • operator: ">" | ">=" | "=" | "<=" | "<"

      An equality and/or inequality string.

    Returns boolean

Generated using TypeDoc