maintainer.name field can also be null (#182)

fixes #181
This commit is contained in:
Rok Garbas 2020-09-07 18:36:24 +02:00 committed by GitHub
parent 2a441c95d9
commit 7f91e92d8f
Failed to generate hash of commit

View file

@ -77,7 +77,7 @@ type alias ResultPackageLicense =
type alias ResultPackageMaintainer = type alias ResultPackageMaintainer =
{ name : String { name : Maybe String
, email : String , email : String
, github : Maybe String , github : Maybe String
} }
@ -342,7 +342,7 @@ viewResultItemDetails channel item =
Nothing -> Nothing ->
"#" "#"
] ]
[ text <| maintainer.name ++ " <" ++ maintainer.email ++ ">" ] [ text <| Maybe.withDefault "" maintainer.name ++ " <" ++ maintainer.email ++ ">" ]
asPre value = asPre value =
pre [] [ text value ] pre [] [ text value ]
@ -460,7 +460,7 @@ decodeResultPackageLicense =
decodeResultPackageMaintainer : Json.Decode.Decoder ResultPackageMaintainer decodeResultPackageMaintainer : Json.Decode.Decoder ResultPackageMaintainer
decodeResultPackageMaintainer = decodeResultPackageMaintainer =
Json.Decode.map3 ResultPackageMaintainer Json.Decode.map3 ResultPackageMaintainer
(Json.Decode.field "name" Json.Decode.string) (Json.Decode.field "name" (Json.Decode.nullable Json.Decode.string))
(Json.Decode.field "email" Json.Decode.string) (Json.Decode.field "email" Json.Decode.string)
(Json.Decode.field "github" (Json.Decode.nullable Json.Decode.string)) (Json.Decode.field "github" (Json.Decode.nullable Json.Decode.string))