first version string
operator string (could be "===", "!==", "", "=", "==", "!=", ">", ">=", "<", "<=")
second version string
Optional
optionsOrLoose: boolean | Optionsan 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
true
if the comparison is true, false
otherwise
Pass in a comparison string, and it'll call the corresponding semver comparison function.
Throws if an invalid comparison string is provided.
Example
Remarks
build identifier (
[+BUILD]
) is not taken into account in all operations but "===" and "!==" which do simple comparison of the whole strings