We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2be3c4f commit d8fe564Copy full SHA for d8fe564
prelude.js
@@ -14,12 +14,18 @@ const identity = x => x
14
15
const concat = (xs, list) => xs.concat(list)
16
17
-const union = compose([uniq, identity])
+const union = compose([uniq, concat])
18
19
const join = separator => xs => xs.join(separator)
20
21
const split = separator => str => str.split(separator)
22
23
-const pathUnion = compose([join('/'), union, split('/'), concat])
+const map = (fn, xs) => xs.map(fn)
24
+
25
+const chain = fn => xs => [].concat.apply([], map(fn, xs))
26
27
+const of = Array.of.bind(Array)
28
29
+const pathUnion = compose([join('/'), union, chain(split('/')), of])
30
31
exports.pathUnion = pathUnion
0 commit comments