mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
imp: web: support base64 >=1.0
This commit is contained in:
parent
ca03da5968
commit
23d13c9a9f
@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
{-# LANGUAGE GADTs #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
@ -11,6 +12,9 @@ module Hledger.Web.Widget.AddForm
|
||||
) where
|
||||
|
||||
import Control.Monad.State.Strict (evalStateT)
|
||||
#if MIN_VERSION_base64(1,0,0)
|
||||
import Data.Base64.Types (extractBase64)
|
||||
#endif
|
||||
import Data.Bifunctor (first)
|
||||
import Data.Foldable (toList)
|
||||
import Data.List (dropWhileEnd, unfoldr)
|
||||
@ -192,7 +196,11 @@ toBloodhoundJson ts =
|
||||
]
|
||||
where
|
||||
-- decodeBase64EncodedText is defined in add-form.hamlet
|
||||
b64wrap = ("decodeBase64EncodedText(\""<>) . (<>"\")") . encodeBase64
|
||||
b64wrap = ("decodeBase64EncodedText(\""<>) . (<>"\")") .
|
||||
#if MIN_VERSION_base64(1,0,0)
|
||||
extractBase64 .
|
||||
#endif
|
||||
encodeBase64
|
||||
|
||||
zipDefault :: a -> [a] -> [a] -> [(a, a)]
|
||||
zipDefault def (b:bs) (c:cs) = (b, c):(zipDefault def bs cs)
|
||||
|
@ -94,7 +94,7 @@ library:
|
||||
- hledger-lib >=1.33.99 && <1.34
|
||||
- hledger >=1.33.99 && <1.34
|
||||
- aeson >=1 && <2.3
|
||||
- base64 <1
|
||||
- base64
|
||||
- blaze-html
|
||||
- blaze-markup
|
||||
- bytestring
|
||||
|
@ -9,8 +9,6 @@ packages:
|
||||
- hledger-web
|
||||
|
||||
extra-deps:
|
||||
- base64-0.4.2.4 # hledger-web does not yet support base64-1
|
||||
|
||||
- process-1.6.19.0 # for HSEC-2024-0003
|
||||
- haskeline-0.8.2.1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user