🐛 Fix future linter issues on wasm shape impl

This commit is contained in:
Andrey Antukh
2025-09-17 11:55:50 +02:00
committed by David Barragán Merino
parent 3c45a8d0b4
commit e88039e46a

View File

@@ -14,7 +14,7 @@
[app.main.refs :as refs] [app.main.refs :as refs]
[app.render-wasm.api :as api] [app.render-wasm.api :as api]
[beicon.v2.core :as rx] [beicon.v2.core :as rx]
[clojure.core :as c] [cljs.core :as c]
[cuerdas.core :as str])) [cuerdas.core :as str]))
(declare ^:private impl-assoc) (declare ^:private impl-assoc)
@@ -42,37 +42,38 @@
;; Marker protocol ;; Marker protocol
shape/IShape shape/IShape
IWithMeta c/IWithMeta
(-with-meta [_ meta] (-with-meta [_ meta]
(ShapeProxy. id type (with-meta delegate meta))) (ShapeProxy. id type (with-meta delegate meta)))
IMeta c/IMeta
(-meta [_] (meta delegate)) (-meta [_] (meta delegate))
ICollection c/ICollection
(-conj [coll entry] (-conj [coll entry]
(impl-conj coll entry)) (impl-conj coll entry))
IEquiv c/IEquiv
(-equiv [coll other] (-equiv [coll other]
(c/equiv-map coll other)) (c/equiv-map coll other))
IHash c/IHash
(-hash [coll] (hash (into {} coll))) (-hash [coll]
(hash (into {} coll)))
ISequential c/ISequential
ISeqable c/ISeqable
(-seq [_] (-seq [_]
(cons (map-entry :id id) (cons (map-entry :id id)
(cons (map-entry :type type) (cons (map-entry :type type)
(c/-seq delegate)))) (c/-seq delegate))))
ICounted c/ICounted
(-count [_] (-count [_]
(+ 1 (count delegate))) (+ 1 (count delegate)))
ILookup c/ILookup
(-lookup [coll k] (-lookup [coll k]
(-lookup coll k nil)) (-lookup coll k nil))
@@ -82,7 +83,7 @@
:type type :type type
(c/-lookup delegate k not-found))) (c/-lookup delegate k not-found)))
IFind c/IFind
(-find [_ k] (-find [_ k]
(case k (case k
:id :id
@@ -91,7 +92,7 @@
(map-entry :type type) (map-entry :type type)
(c/-find delegate k))) (c/-find delegate k)))
IAssociative c/IAssociative
(-assoc [coll k v] (-assoc [coll k v]
(impl-assoc coll k v)) (impl-assoc coll k v))
@@ -100,18 +101,18 @@
(= k :type) (= k :type)
(contains? delegate k))) (contains? delegate k)))
IMap c/IMap
(-dissoc [coll k] (-dissoc [coll k]
(impl-dissoc coll k)) (impl-dissoc coll k))
IFn c/IFn
(-invoke [coll k] (-invoke [coll k]
(-lookup coll k nil)) (-lookup coll k nil))
(-invoke [coll k not-found] (-invoke [coll k not-found]
(-lookup coll k not-found)) (-lookup coll k not-found))
IPrintWithWriter c/IPrintWithWriter
(-pr-writer [_ writer _] (-pr-writer [_ writer _]
(-write writer (str "#penpot/shape " (:id delegate))))) (-write writer (str "#penpot/shape " (:id delegate)))))