(defn find-js-classpath
"Returns a seq of URLs of all JavaScript files on the classpath."
[path]
(->> (all-classpath-urls)
(map io/file)
(reduce
(fn [files jar-or-dir]
(let [name (.toLowerCase (.getName ^File jar-or-dir))
ext (.substring name (inc (.lastIndexOf name ".")))]
(->> (when (.exists ^File jar-or-dir)
(cond
(.isDirectory ^File jar-or-dir)
(find-js-fs (str (.getAbsolutePath ^File jar-or-dir) "/" path))
(#{"jar" "zip"} ext)
(find-js-jar jar-or-dir path)
:else nil))
(remove nil?)
(into files))))
[])))