File tree 3 files changed +5
-7
lines changed
3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 19
19
20
20
extname :: FilePath -> FilePath
21
21
22
- join :: FilePath -> FilePath -> FilePath
22
+ join :: [ FilePath] -> FilePath
23
23
24
24
normalize :: FilePath -> FilePath
25
25
Original file line number Diff line number Diff line change @@ -17,11 +17,9 @@ foreign import normalize
17
17
-- Joins two path segments together and normalizes the resulting path.
18
18
--
19
19
foreign import join
20
- " var join = function (start) { \
21
- \ return function (end) { \
22
- \ return require('path').join(start, end); \
23
- \ }; \
24
- \}" :: FilePath -> FilePath -> FilePath
20
+ " var join = function (segments) { \
21
+ \ return require('path').join.apply(this, segments); \
22
+ \}" :: [FilePath ] -> FilePath
25
23
26
24
-- |
27
25
-- Resolves `to` to an absolute path ([from...], to).
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ assertEq x y =
13
13
14
14
main = do
15
15
assertEq (normalize " /foo/bar//baz/asdf/quux/.." ) (normalize " /foo/bar/baz/asdf" )
16
- assertEq (join " /foo" " bar" ) (normalize " /foo/bar" )
16
+ assertEq (join [ " /foo" , " bar" ] ) (normalize " /foo/bar" )
17
17
-- assertEq (resolve ["foo/bar", "tmp/file/", ".."] "a/../subfile") (normalize "/foo/bar")
18
18
assertEq (relative " /data/orandea/test/aaa" " /data/orandea/impl/bbb" ) (normalize " ../../impl/bbb" )
19
19
assertEq (dirname " /foo/bar/baz/asdf/quux" ) (normalize " /foo/bar/baz/asdf" )
You can’t perform that action at this time.
0 commit comments