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:

    boolean

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:

Returns:

  1. uint major
  2. uint minor
  3. uint patch
generated by LDoc 1.4.6 Last updated 2021-09-10 19:51:19