panthershark/email-parser/1.0.0

NOTE: the latest version is 1.0.2

Rerouted (regenerated, verified). Same repository and tag, but GitHub now builds the zip with different bytes, so it no longer matches the SHA-1 package.elm-lang.org recorded. The Lamdera package server serves a copy recovered from https://github.com/panthershark/email-parser.

What we checked: Tag 1.0.0 is still on github.com/panthershark/email-parser; its commit 31dcdbf7f766 is from 2019-12-18 03:23 UTC, before the version was published (2019-12-18 03:23 UTC); elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one (GitHub's zip no longer comes out byte for byte the same), so the contents were checked instead.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/panthershark/email-parser/zipball/1.0.0/

Email

Email parser and validation library.

type alias EmailAddress =
{ local : String
, domain : String
}

A model for representing an email. This is exposed, but you'll probably only use it is using parseEmailAddress

isValid : String -> Bool

Given a string, this returns true if the email is compatible with the spec.

    isValid "[email protected]" == True
    isValid "^^^^" == False
parse : String -> Result (List DeadEnd) EmailAddress

Given a string, parses into an EmailAddress model.

    parse "[email protected]" == Ok { local = "hello", domain = "world.com" }
    parse "^^^^" == Err [ dead ends ]
toString : EmailAddress -> String

Converts the EmailAddress model to a string.