Skip to content

Commit 30a1481

Browse files
authored
feature(PRELUDE) clean up slashes
1 parent bd447ae commit 30a1481

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

prelude.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ const chain = fn => xs => [].concat.apply([], xs.map(fn))
2424

2525
const of = Array.of.bind(Array)
2626

27-
const pathUnion = compose([join('/'), union, chain(split('/')), of])
27+
const filter = xs => fn => xs.filter(fn)
28+
29+
const prepend = a => b => a.concat(b)
30+
31+
const pathUnion = compose([prepend('/'), join('/'), filter(Boolean), union, chain(split('/')), of])
2832

2933
exports.pathUnion = pathUnion

0 commit comments

Comments
 (0)