-- |Internal helper utilities. Subject to change. Avoid relying on anything
-- found in here.
module Hakyll.Typescript.Internal
  (
    minifyJs,
    withMinifyJs
  )
  where

import           Data.ByteString.Lazy (ByteString)
import           Hakyll (withItemBody, Compiler, Item)
import           Text.Jasmine

minifyJs :: ByteString -> Compiler ByteString
minifyJs :: ByteString -> Compiler ByteString
minifyJs = ByteString -> Compiler ByteString
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ByteString -> Compiler ByteString)
-> (ByteString -> ByteString) -> ByteString -> Compiler ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> ByteString
minify

withMinifyJs :: Compiler (Item ByteString) -> Compiler (Item ByteString)
withMinifyJs :: Compiler (Item ByteString) -> Compiler (Item ByteString)
withMinifyJs Compiler (Item ByteString)
m = Compiler (Item ByteString)
m Compiler (Item ByteString)
-> (Item ByteString -> Compiler (Item ByteString))
-> Compiler (Item ByteString)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ByteString -> Compiler ByteString)
-> Item ByteString -> Compiler (Item ByteString)
forall a b. (a -> Compiler b) -> Item a -> Compiler (Item b)
withItemBody ByteString -> Compiler ByteString
minifyJs