Function eq

v1 == v2 This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings.

eq('1.2.3', '1.2.3') // true

build identifier ([+BUILD]) is not taken into account

  • Parameters

    • v1: string

      first version string

    • v2: string

      second version string

    • OptionaloptionsOrLoose: boolean | Options

      an options object { loose } (where loose is the only available option) or a boolean indicating whether to enable loose mode. In loose mode, the parser is more forgiving with imperfectly formatted semver strings

    Returns boolean

    true if v1 == v2, false if v1 != v2