We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 026314e commit 3a5d796Copy full SHA for 3a5d796
src/Lib/Util.elm
@@ -2,6 +2,7 @@ module Lib.Util exposing (..)
2
3
import Http
4
import Json.Decode as Decode
5
+import Json.Decode.Extra exposing (when)
6
import List.Nonempty as NEL
7
import Process
8
import Task
@@ -90,6 +91,16 @@ decodeTag =
90
91
Decode.field "tag" Decode.string
92
93
94
+whenTagIs : String -> Decode.Decoder String -> Decode.Decoder String
95
+whenTagIs val =
96
+ whenPathIs [ "tag" ] val
97
+
98
99
+whenPathIs : List String -> String -> Decode.Decoder String -> Decode.Decoder String
100
+whenPathIs path val =
101
+ when (Decode.at path Decode.string) ((==) val)
102
103
104
decodeUrl : Decode.Decoder Url
105
decodeUrl =
106
let
0 commit comments