Skip to content

Commit

Permalink
Add util for encode value
Browse files Browse the repository at this point in the history
Co-authored-by: @ghrpp <profunctorlense@gmail.com>
  • Loading branch information
Panthevm and ApricotLace committed Dec 13, 2023
1 parent 6d37790 commit eef4eff
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/suitkin/utils.cljc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
(ns suitkin.utils
#?(:cljs (:require [reagent.core])))
#?(:cljs (:require [reagent.core])
:clj (:import [java.net.URLDecoder]
[java.nio.charset.StandardCharsets])))

#?(:cljs (goog-define CLASSPATH "")
:clj (def CLASSPATH ""))
Expand Down Expand Up @@ -37,4 +39,9 @@
(defn target-value
[event]
#?(:cljs (.. event -target -value)
:cljs (-> event :target :value)))
:clj (-> event :target :value)))

(defn encode-uri
[value]
#?(:cljs (js/encodeURI value)
:clj (java.net.URLDecoder/encode value java.nio.charset.StandardCharsets/UTF_8)))

0 comments on commit eef4eff

Please sign in to comment.