0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 07:41:43 -05:00

🐛 Fix wrong type hints

This commit is contained in:
Andrey Antukh 2022-03-29 18:23:39 +02:00 committed by Andrés Moya
parent 6f7f74f7c6
commit f303d3c45d
4 changed files with 14 additions and 14 deletions

View file

@ -26,7 +26,7 @@
(toString [_]
(str "matrix(" a "," b "," c "," d "," e "," f ")")))
(defn ^boolean matrix?
(defn matrix?
"Return true if `v` is Matrix instance."
[v]
(instance? Matrix v))

View file

@ -21,7 +21,7 @@
(defn s [{:keys [x y]}] (str "(" x "," y ")"))
(defn ^boolean point?
(defn point?
"Return true if `v` is Point instance."
[v]
(or (instance? Point v)
@ -33,7 +33,7 @@
(s/def ::point
(s/and (s/keys :req-un [::x ::y]) point?))
(defn ^boolean point-like?
(defn point-like?
[{:keys [x y] :as v}]
(and (map? v)
(not (nil? x))

View file

@ -17,28 +17,28 @@
;; GENERIC SHAPE SELECTORS AND PREDICATES
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn ^boolean root-frame?
(defn root-frame?
[{:keys [id type]}]
(and (= type :frame)
(= id uuid/zero)))
(defn ^boolean frame-shape?
(defn frame-shape?
[{:keys [type]}]
(= type :frame))
(defn ^boolean group-shape?
(defn group-shape?
[{:keys [type]}]
(= type :group))
(defn ^boolean text-shape?
(defn text-shape?
[{:keys [type]}]
(= type :text))
(defn ^boolean image-shape?
(defn image-shape?
[{:keys [type]}]
(= type :image))
(defn ^boolean unframed-shape?
(defn unframed-shape?
"Checks if it's a non-frame shape in the top level."
[shape]
(and (not (frame-shape? shape))
@ -218,7 +218,7 @@
([libraries library-id component-id]
(get-in libraries [library-id :data :components component-id])))
(defn ^boolean is-main-of?
(defn is-main-of?
[shape-main shape-inst]
(and (:shape-ref shape-inst)
(or (= (:shape-ref shape-inst) (:id shape-main))

View file

@ -63,16 +63,16 @@
(filter match?)
(seq))))
(defn ^boolean is-text-node?
(defn is-text-node?
[node]
(and (string? (:text node))
(not= (:text node) "")))
(defn ^boolean is-paragraph-node?
(defn is-paragraph-node?
[node]
(= "paragraph" (:type node)))
(defn ^boolean is-root-node?
(defn is-root-node?
[node]
(= "root" (:type node)))