Skip to content

Munksgaard/elm-data-uri

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elm-data-uri

elm-data-uri lets you parse and handle data URIs like data:text/vnd-example+xyz;foo=bar;base64,R0lGODdh and data:text/plain;charset=UTF-8;page=21,the%20data:1234,5678 in Elm.

Here is an example of how it works:

DataUri.fromString "data:text/vnd-example+xyz;foo=bar;base64,R0lGODdh"
  == Just
        { mediaType =
            { parameters = Dict.fromList [ ( "foo", "bar" ) ]
            , registrationTree = Nothing
            , subtype = "vnd-example"
            , suffix = Just "xyz"
            , type_ = MediaType.Text
            }
        , data =
            Bytes.Encode.string "GIF87"
                |> Bytes.Encode.encode
                |> DataUri.Base64
        }

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages