utils

GLOBALS

CLASSES

Version

ATTRIBUTES

  • major: number
  • minor: number
  • patch: number

VARIABLES

FUNCTIONS

contains(t: table, element: any) -> boolean

Returns true if t contains element, based on the == operator

filter(t: table, predicate: function(e: any) -> boolean) -> table

Filters table t based on whether predicate(element) is true for each element of t

map(t: table, mapper: function(element: any) -> any) -> table

Maps each element of table t with mapper. Returns the new table.

reduce(t: table, reducer: function(previous: any, current: any), initial: any) -> any

Reduces table t using the reducer reducer. initial is nil by default.

parseVersion(version: string) -> Version

Parses a semantic version string into its components

v2GreaterThanV1(v1: string, v2: string) -> boolean

Returns true if v2 is after v1, false otherwise. Used to check for updates most notably.

mergeTables(table1: table, table2: table, logger: Logger) -> table

Merges two key-value tables recursively, overwriting the values of the first table with the values of the second table