code: function compareDottedVersion(v1, v2) {
    const parts1 = /([0-9.]+)(.*)$/.exec(v1)
    const parts2 = /([0-9.]+)(.*)$/.exec(v2)
    if (parts1 != null && parts2 != null) {
      const numbers1 = parts1[1]
      const numbers2 = parts2[1]
      const distinguisher1 = parts1[2]
      const distinguisher2 = parts2[2]
      const numlist1 = numbers1.split('.').map(e => +e)
      const numlist2 = numbers2.split('.').map(e => +e)
      const cmp = listCompare(numlist1, numlist2)
      if (cmp !== 0) {
        return cmp
      } else {
        return distinguisher1 < distinguisher2
          ? -1
          : distinguisher1 > distinguisher2
          ? 1
          : 0
      }
    }
    return v1 < v2 ? -1 : v1 > v2 ? 1 : 0
  }
docs: Take string versions. -1 if v1 < v2, 1 if v1 > v2, 0 otherwise.