aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PursLoader/Options.purs
diff options
context:
space:
mode:
authoreric thul <thul.eric@gmail.com>2016-03-12 14:55:05 -0500
committereric thul <thul.eric@gmail.com>2016-03-12 14:55:05 -0500
commitcb2f4c886fd1057fbf0511b46cab3489123ced23 (patch)
tree5079dcf661e96520e9b37562b47ab4d83bc7496a /src/PursLoader/Options.purs
parent1c49c88ed60341341ab2b82aba738e8fc1179941 (diff)
parent55120f4502cb76e768f60654f3937db809df8ade (diff)
downloadpurs-loader-cb2f4c886fd1057fbf0511b46cab3489123ced23.tar.gz
purs-loader-cb2f4c886fd1057fbf0511b46cab3489123ced23.tar.zst
purs-loader-cb2f4c886fd1057fbf0511b46cab3489123ced23.zip
Merge branch 'master' into topic/stderr
Diffstat (limited to 'src/PursLoader/Options.purs')
-rw-r--r--src/PursLoader/Options.purs30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/PursLoader/Options.purs b/src/PursLoader/Options.purs
deleted file mode 100644
index 0c1453e..0000000
--- a/src/PursLoader/Options.purs
+++ /dev/null
@@ -1,30 +0,0 @@
1module PursLoader.Options
2 ( Options(..)
3 , runOptions
4 ) where
5
6import Prelude ((<$>), (<<<), id)
7
8import Data.Foreign.Class (IsForeign, readProp)
9import Data.Foreign.NullOrUndefined (runNullOrUndefined)
10import Data.Maybe (maybe)
11
12import PursLoader.Path (joinPath)
13
14newtype Options = Options { bundleOutput :: String }
15
16type Options_ = { bundleOutput :: String }
17
18runOptions :: Options -> Options_
19runOptions (Options options) = options
20
21instance isForeignOptions :: IsForeign Options where
22 read obj =
23 Options <$> ({ bundleOutput: _ }
24 <$> (maybe bundleOutputDefault id <<< runNullOrUndefined <$> readProp bundleOutput obj))
25 where
26 bundleOutput :: String
27 bundleOutput = "bundleOutput"
28
29 bundleOutputDefault :: String
30 bundleOutputDefault = joinPath "output" "bundle.js"