From 0d870610e189c2a4334ecedf02c7219c8e5c8770 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Tue, 1 Oct 2024 09:14:54 +0200 Subject: [PATCH] Fix infer warnings in tokens test --- frontend/src/app/main/ui/components/tab_container.cljs | 2 ++ frontend/src/app/main/ui/workspace/tokens/tinycolor.cljs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/ui/components/tab_container.cljs b/frontend/src/app/main/ui/components/tab_container.cljs index 1e3b99079..0d39e93d8 100644 --- a/frontend/src/app/main/ui/components/tab_container.cljs +++ b/frontend/src/app/main/ui/components/tab_container.cljs @@ -16,6 +16,8 @@ [cuerdas.core :as str] [rumext.v2 :as mf])) +(set! *warn-on-infer* false) + (mf/defc tab-element {::mf/wrap-props false} [{:keys [children]}] diff --git a/frontend/src/app/main/ui/workspace/tokens/tinycolor.cljs b/frontend/src/app/main/ui/workspace/tokens/tinycolor.cljs index 91fac6bdf..9a8d74f10 100644 --- a/frontend/src/app/main/ui/workspace/tokens/tinycolor.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/tinycolor.cljs @@ -6,18 +6,18 @@ (:require ["tinycolor2" :as tinycolor])) -(defn tinycolor? [x] +(defn tinycolor? [^js x] (and (instance? tinycolor x) (.isValid x))) (defn valid-color [color-str] (let [tc (tinycolor color-str)] (when (.isValid tc) tc))) -(defn ->hex [tc] +(defn ->hex [^js tc] (assert (tinycolor? tc)) (.toHex tc)) -(defn color-format [tc] +(defn color-format [^js tc] (assert (tinycolor? tc)) (.getFormat tc))