Skip to content

Commit 2d50e61

Browse files
committed
Merge pull request #1 from andreypopp/master
join :: [FilePath] -> FilePath
2 parents b09b376 + 2bd33ce commit 2d50e61

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
extname :: FilePath -> FilePath
2121

22-
join :: FilePath -> FilePath -> FilePath
22+
join :: [FilePath] -> FilePath
2323

2424
normalize :: FilePath -> FilePath
2525

Diff for: src/Node/Path.purs

+3-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ foreign import normalize
1717
-- Joins two path segments together and normalizes the resulting path.
1818
--
1919
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
2523

2624
-- |
2725
-- Resolves `to` to an absolute path ([from...], to).

Diff for: tests/Simple.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ assertEq x y =
1313

1414
main = do
1515
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")
1717
--assertEq (resolve ["foo/bar", "tmp/file/", ".."] "a/../subfile") (normalize "/foo/bar")
1818
assertEq (relative "/data/orandea/test/aaa" "/data/orandea/impl/bbb") (normalize "../../impl/bbb")
1919
assertEq (dirname "/foo/bar/baz/asdf/quux") (normalize "/foo/bar/baz/asdf")

0 commit comments

Comments
 (0)