Created
June 3, 2021 18:13
-
-
Save vyuh/8fdc486400ced3a07c12bd69f860af59 to your computer and use it in GitHub Desktop.
IGNORE PATH AND GET QUERY PARAMETER
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getExam : String -> Maybe String | |
getExam str = case Url.fromString str of | |
Nothing -> Nothing | |
Just u -> | |
Maybe.withDefault Nothing (Url.Parser.parse (Url.Parser.query (Url.Parser.Query.string "exam")) { u | path = "" }) | |
extractSearchArgument : String -> Url -> Maybe String | |
extractSearchArgument key location = | |
{ location | path = "" } | |
|> Url.Parser.parse (Url.Parser.query (Url.Parser.Query.string key)) | |
|> Maybe.withDefault Nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment