UAInspector v0.19.0 UAInspector.Util.OS View Source

Utility methods for operating system lookups.

Link to this section Summary

Functions

Checks whether an operating system is treated as "desktop only"

Returns the OS family for an OS short code

Returns the proper case version of a downcase os name

Link to this section Functions

Link to this function

desktop_only?(arg1) View Source
desktop_only?(os :: map() | :unknown) :: boolean()

Checks whether an operating system is treated as "desktop only".

Link to this function

family(short_code) View Source
family(short_code :: String.t()) :: String.t() | nil

Returns the OS family for an OS short code.

Unknown short codes return nil as their family.

Link to this function

proper_case(os) View Source
proper_case(os :: String.t()) :: String.t()

Returns the proper case version of a downcase os name.

Unknown names are returned unmodified.

Examples

iex> proper_case("debian")
"Debian"

iex> proper_case("--UnKnOnWn--")
"--UnKnOnWn--"