cljs.repl.browser/parse-file

functionremoved v1.7.10added v0.0-3053Edit
(parse-file {:keys [host host-port port], :as repl-env} file {:keys [asset-path], :as opts})

Source code @ clojurescript:src/main/clojure/cljs/repl/browser.clj
(defn parse-file [{:keys [host host-port port] :as repl-env} file {:keys [asset-path] :as opts}]
  (let [base-url-pattern (Pattern/compile (str "http://" host ":" (or host-port port) "/"))]
    (if (re-find base-url-pattern file)
      (-> file
        (string/replace base-url-pattern "")
        (string/replace
          (Pattern/compile
            (str "^" (or asset-path (util/output-directory opts)) "/")) ""))
      (if-let [asset-root (:asset-root opts)]
        (string/replace file asset-root "")
        (throw
          (ex-info (str "Could not relativize URL " file)
            {:type :parse-stacktrace
             :reason :relativize-url}))))))