mirror of
https://github.com/github/semantic.git
synced 2024-12-26 16:33:03 +03:00
Unpack the rows.
This commit is contained in:
parent
5304663642
commit
94f97ba366
@ -29,9 +29,10 @@ import Term
|
|||||||
-- | Render a diff to a string representing its JSON.
|
-- | Render a diff to a string representing its JSON.
|
||||||
json :: Renderer a ByteString
|
json :: Renderer a ByteString
|
||||||
json diff sources = toLazyByteString . fromEncoding . pairs $
|
json diff sources = toLazyByteString . fromEncoding . pairs $
|
||||||
"rows" .= Prelude.fst (splitDiffByLines diff (pure 0) (source <$> sources))
|
"rows" .= annotateRows (Prelude.fst (splitDiffByLines diff (pure 0) (source <$> sources)))
|
||||||
<> "oids" .= (oid <$> sources)
|
<> "oids" .= (oid <$> sources)
|
||||||
<> "paths" .= (path <$> sources)
|
<> "paths" .= (path <$> sources)
|
||||||
|
where annotateRows = fmap unRow
|
||||||
|
|
||||||
instance ToJSON Category where
|
instance ToJSON Category where
|
||||||
toJSON (Other s) = String $ T.pack s
|
toJSON (Other s) = String $ T.pack s
|
||||||
|
Loading…
Reference in New Issue
Block a user