Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/refactor_nrepl/ns/clean_ns.clj
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
(assert-no-exclude-clause (core/get-ns-component ns-form :use))
ns-form)

(defn- find
(defn- seek
"Find the first element in coll that satisfies pred?"
[pred? coll]
(reduce (fn [_ x] (when (pred? x) (reduced x))) nil coll))

(defn clean-ns [{:keys [path relative-path]}]
(let [path (find #(and % (.exists (io/file %)))
(let [path (seek #(and % (.exists (io/file %)))
Comment thread
plexus marked this conversation as resolved.
Outdated
[path relative-path])]
(assert (core/source-file? path))
;; Prefix notation not supported in cljs.
Expand Down