cmp

external fun cmp(v1: String, operator: Operator, v2: String): Boolean(source)
external fun cmp(v1: String, operator: Operator, v2: String, optionsOrLoose: Boolean = definedExternally): Boolean(source)
external fun cmp(v1: String, operator: Operator, v2: String, optionsOrLoose: Options = definedExternally): Boolean(source)
external fun cmp(v1: String, operator: Operator, v2: SemVer): Boolean(source)
external fun cmp(v1: String, operator: Operator, v2: SemVer, optionsOrLoose: Boolean = definedExternally): Boolean(source)
external fun cmp(v1: String, operator: Operator, v2: SemVer, optionsOrLoose: Options = definedExternally): Boolean(source)
external fun cmp(v1: SemVer, operator: Operator, v2: String): Boolean(source)
external fun cmp(v1: SemVer, operator: Operator, v2: String, optionsOrLoose: Boolean = definedExternally): Boolean(source)
external fun cmp(v1: SemVer, operator: Operator, v2: String, optionsOrLoose: Options = definedExternally): Boolean(source)
external fun cmp(v1: SemVer, operator: Operator, v2: SemVer): Boolean(source)
external fun cmp(v1: SemVer, operator: Operator, v2: SemVer, optionsOrLoose: Boolean = definedExternally): Boolean(source)
external fun cmp(v1: SemVer, operator: Operator, v2: SemVer, optionsOrLoose: Options = definedExternally): Boolean(source)

Pass in a comparison string, and it'll call the corresponding semver comparison function. "===" and "!==" do simple string comparison, but are included for completeness. Throws if an invalid comparison string is provided.