Kase (kase v0.2.0)

A module for converting strings between different casing styles.

Summary

Functions

Converts a given string to the specified target_case.

Functions

Link to this function

convert(string, target_case)

@spec convert(String.t() | map(), atom()) :: String.t()

Converts a given string to the specified target_case.

Examples

iex> Kase.convert("this-variable-name", :camel_case)
"thisVariableName"

iex> Kase.convert("ThisIsPascalCase", :snake_case)
"this_is_pascal_case"

map_input = %{"first_key" => "value", "second_key" => "value"}
iex> Kase.convert(map_input, :camel_case)
%{"firstKey" => "value", "secondKey" => "value"}
Link to this function

convert(map, target_case, options \\ [])

@spec convert(map(), atom(), Keyword.t()) :: map()