s6o/elm-recase/1.0.1

ReCase

Convert a string from a case to any other case.

Generic API

type ReCase
= ToCamel
| ToConstant
| ToDot
| ToKebab
| ToPascal
| ToPath
| ToSentence
| ToSnake
| ToTitle
recase : ReCase -> String -> String

Recase input to specified case.

More Explicitly Typed API

A camelCase String.

fromCamel : CamelCase -> String

Convert from the specific CamelCase type to the generic String type.

toCamel : String -> CamelCase

Convert String to CamelCase.

A CONSTANT_CASE String.

Convert from the specific ConstantCase type to the generic String type.

Convert String to ConstantCase.

type DotCase

A dot.case String.

fromDot : DotCase -> String

Convert from the specific DotCase type to the generic String type.

toDot : String -> DotCase

Convert String to DotCase.

A kebab-case String.

fromKebab : KebabCase -> String

Convert from the specific KebabCase type to the generic String type.

toKebab : String -> KebabCase

Convert String to KebabCase.

A PascalCase aka UpperCase String.

Convert from the specific PascalCase type to the generic String type.

toPascal : String -> PascalCase

Convert String to PacalCase.

A path/case String. Conversions to path/case are case-sensitive, that is input's case is not changed, only the path separator / (slash) is inserted.

fromPath : PathCase -> String

Convert from the specific PathCase type to the generic String type.

toPath : String -> PathCase

Convert String to PathCase.

A Sentence case String.

Convert from the specific SentenceCase type to the generic String type.

Convert String to SentenceCase.

A snake_case String.

fromSnake : SnakeCase -> String

Convert from the specific SnakeCase type to the generic String type.

toSnake : String -> SnakeCase

Convert String to SnakeCase.

A Title Case String.

fromTitle : TitleCase -> String

Convert from the specific TitleCase type to the generic String type.

toTitle : String -> TitleCase

Convert String to TitleCase.