Optional typed helpers for resolved EditorConfig property maps.
Summary
Functions
Reads a case-insensitive boolean property.
Reads indent_size as a positive integer or :tab.
Functions
Reads a case-insensitive boolean property.
Examples
iex> EditorConfig.Properties.boolean(
...> %{"trim_trailing_whitespace" => "TRUE"},
...> "trim_trailing_whitespace"
...> )
{:ok, true}
@spec indent_size(map()) :: {:ok, pos_integer() | :tab} | :error
Reads indent_size as a positive integer or :tab.
Examples
iex> EditorConfig.Properties.indent_size(%{"indent_size" => "2"})
{:ok, 2}
iex> EditorConfig.Properties.indent_size(%{"indent_size" => "tab"})
{:ok, :tab}