function compareVersionPart(part1, part2) {
  // https://github.com/microsoft/winget-cli/blob/ae566c7bf21cfcc75be7ec30e4036a30eede8396/src/AppInstallerSharedLib/Versions.cpp#L324-L352
  const [, numericString1, other1] = part1.trim().match(/^(\d*)(.*)$/)
  const [, numericString2, other2] = part2.trim().match(/^(\d*)(.*)$/)
  const numeric1 = parseInt(numericString1 || '0', 10)
  const numeric2 = parseInt(numericString2 || '0', 10)

  if (numeric1 < numeric2) {
    return -1
  } else if (numeric1 > numeric2) {
    return 1
  }
  // numeric1 === numeric2

  const otherFolded1 = (other1 ?? '').toLowerCase()
  const otherFolded2 = (other2 ?? '').toLowerCase()

  if (otherFolded1.length !== 0 && otherFolded2.length === 0) {
    return -1
  } else if (otherFolded1.length === 0 && otherFolded2.length !== 0) {
    return 1
  }

  if (otherFolded1 < otherFolded2) {
    return -1
  } else if (otherFolded1 > otherFolded2) {
    return 1
  }

  return 0
}
Compares two strings representing version number parts lexicographically and returns an integer value.

@param {string} part1 - The first version part to compare
@param {string} part2 - The second version part to compare
@returns {number} -1 if part1 is smaller than part2, 1 if part1 is larger than part2, 0 if part1 and part2 are equal
@example
compareVersionPart('3', '4') // returns -1 because numeric part of first part is smaller than the numeric part of second part.