blob: 132096c5d6ba73a5486ecc3706c46c49fac552b9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
module PursLoader.Options
( Options()
, runOptions
) where
import Prelude ((<$>), (<<<), id)
import Data.Foreign.Class (IsForeign, readProp)
import Data.Foreign.NullOrUndefined (runNullOrUndefined)
import Data.Maybe (maybe)
import PursLoader.Path (joinPath)
newtype Options = Options { pscBundle :: String }
type Options_ = { pscBundle :: String }
runOptions :: Options -> Options_
runOptions (Options options) = options
instance isForeignOptions :: IsForeign Options where
read obj =
Options <$> ({ pscBundle: _ }
<$> (maybe pscBundleDefault id <<< runNullOrUndefined <$> readProp pscBundle obj))
where
pscBundle :: String
pscBundle = "pscBundle"
pscBundleDefault :: String
pscBundleDefault = joinPath "output" "bundle.js"
|