|
@@ -7,10 +7,18 @@
|
|
|
|
|
|
(defn- has-tag?
|
|
|
[entity tag-ident]
|
|
|
- (let [tags (:block/tags entity)]
|
|
|
- (some (fn [t] (or (= (:db/ident t) tag-ident)
|
|
|
- (= t tag-ident)))
|
|
|
- (if (coll? tags) tags [tags]))))
|
|
|
+ (some (fn [t]
|
|
|
+ (let [db-ident (:db/ident t)]
|
|
|
+ (if (keyword? db-ident)
|
|
|
+ (identical? (.-fqn db-ident) (.-fqn ^keyword tag-ident))
|
|
|
+ (keyword-identical? t tag-ident))))
|
|
|
+ (:block/tags entity)))
|
|
|
+
|
|
|
+(comment
|
|
|
+ (require '[logseq.common.profile :as c.p])
|
|
|
+ (do (vreset! c.p/*key->call-count {})
|
|
|
+ (vreset! c.p/*key->time-sum {}))
|
|
|
+ (c.p/profile-fn! has-tag? :print-on-call? false))
|
|
|
|
|
|
(defn internal-page?
|
|
|
[entity]
|
|
@@ -18,8 +26,8 @@
|
|
|
|
|
|
(defn class?
|
|
|
[entity]
|
|
|
- (or (= (:db/ident entity) :logseq.class/Tag)
|
|
|
- (has-tag? entity :logseq.class/Tag)))
|
|
|
+ (or (has-tag? entity :logseq.class/Tag)
|
|
|
+ (keyword-identical? (:db/ident entity) :logseq.class/Tag)))
|
|
|
|
|
|
(defn property?
|
|
|
[entity]
|
|
@@ -32,7 +40,7 @@
|
|
|
;; db based graph
|
|
|
(has-tag? entity :logseq.class/Whiteboard)
|
|
|
;; file based graph
|
|
|
- (= "whiteboard" (:block/type entity))))
|
|
|
+ (identical? "whiteboard" (:block/type entity))))
|
|
|
|
|
|
(defn closed-value?
|
|
|
[entity]
|
|
@@ -45,7 +53,7 @@
|
|
|
;; db based graph
|
|
|
(has-tag? entity :logseq.class/Journal)
|
|
|
;; file based graph
|
|
|
- (= "journal" (:block/type entity))))
|
|
|
+ (identical? "journal" (:block/type entity))))
|
|
|
|
|
|
(defn page?
|
|
|
[entity]
|