View Source Teiserver.Helpers.SchemaHelper (Teiserver v0.0.1)
A set of functions for helping with schema files
Summary
Functions
Given params and a pair of fields, ensures the lower value of the two is assigned to the first field and the higher value to the second.
Given a list of fields and a list of patterns, will apply Regex.replace for every pattern to each field.
Applied Enum.uniq
to one or more fields in the params
Functions
Given params and a pair of fields, ensures the lower value of the two is assigned to the first field and the higher value to the second.
%{f1: 5, f2: 3} |> min_and_max(~w(f1 f2))
%{f1: 3, f2: 5}
Given a list of fields and a list of patterns, will apply Regex.replace for every pattern to each field.
Applied Enum.uniq
to one or more fields in the params