Vendetta/API/compare sem ver

From Quasar-RCE
Jump to navigationJump to search

Definition

lib.compare_sem_ver (version string 1, version string 2) :: number result

Description

Compare two version strings and determine which is higher

Arguments

  1. string version 1: version to compare against
  2. string version 2: version being compared

Returns

  1. number result: -1 if the first argument is higher, 1 if the second argument is higher. returns 0 if both arguments appear the same

Other notes

  • Created in LME 3.4.x
  • Version strings are broken apart using lib.get_whole_ver.
  • While the naming of the function intends for Semantic versioning to be used, as long as the versions being compared are breakable with get_whole_ver and consistant in numbering, this function should work just fine.