red-g / directory / Path

An absolute path to either a file or a directory. Give these to your backend to load them into Elm!


type Path
    = File File
    | Directory Directory

An absolute path to either a file or a directory. Give these to your backend to load them into Elm!

decoder : Json.Decode.Decoder Path

Decode a Path from the following JSON schema:

    {
        "File"?: <Path.File>,
        "Directory"?: <Path.Directory>
    }

encode : Path -> Json.Encode.Value

Encode a Path to the following JSON schema:

    {
        "File"?: <Path.File>,
        "Directory"?: <Path.Directory>
    }