Module Version
Comparison of "Major.Minor.Patch" triplets.
Module Status: Experimental 2020-10-31.
Usage:
local Version = require('__eradicators-library__/erlib/factorio/Version')()
Functions
compare(versionA, operator, versionB) | Compares two version strings directly. |
parse(versionA) | Converts a version string to three int values. |
Functions
- compare(versionA, operator, versionB)
-
Compares two version strings directly. If minor or patch are blank they
are assumed to be 0.
Parameters:
Returns:
Usage:
print(Version.compare('1','==','1.0.0')) > true print(Version.compare('2.3.5','>','2.0')) > true print(Version.compare('2.3.5','>','2.3.5')) > false print(Version.compare('555','~=','555.0.0')) > false
- parse(versionA)
-
Converts a version string to three int values.
Parameters:
- versionA string
Returns: