elm/project-metadata-utils/1.0.0

NOTE: the latest version is 1.0.2

Elm.Module

Helpers for working with module name strings in elm.json files.

Modules

type Name

A guaranteed valid Elm module name.

String Conversions

toString : Name -> String

Convert a Name to a String that works in elm.json

fromString : String -> Maybe Name

Try to convert a String into a Name:

fromString "Maybe"       == Just ...
fromString "Elm.Name"  == Just ...
fromString "Json.Decode" == Just ...
fromString "json.decode" == Nothing
fromString "Json_Decode" == Nothing

JSON Conversions

encode : Name -> Value

Turn a Name into a string for use in elm.json

decoder : Decoder Name

Decode the module name strings that appear in elm.json