1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Use hasChanges in the JSON.

This commit is contained in:
Rob Rix 2016-03-02 08:05:53 -05:00
parent ced884d79b
commit 5eaa843abc

View File

@ -60,7 +60,7 @@ instance ToJSON (Term leaf Info) where
toEncoding (info :< syntax) = pairs $ mconcat (termFields info syntax)
lineFields :: KeyValue kv => Int -> Line (SplitDiff leaf Info) -> [kv]
lineFields n line = [ "number" .= n, "terms" .= unLine line, "hasChanges" .= Prelude.or (Prelude.or . (True <$) <$> line) ]
lineFields n line = [ "number" .= n, "terms" .= unLine line, "hasChanges" .= hasChanges line ]
termFields :: (ToJSON recur, KeyValue kv) => Info -> Syntax leaf recur -> [kv]
termFields (Info range categories) syntax = "range" .= range : "categories" .= categories : case syntax of