File tree 1 file changed +11
-4
lines changed
src/lib/devtools/formatters
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 57
57
(number? v) v
58
58
:else " ?" ))
59
59
60
- (defn seek-path-segment [coll val]
60
+ (defn seek-path-segment [coll val & [seq'd-map?] ]
61
61
(let [* (fn [[k v]]
62
62
(cond
63
63
; ; we need to know the paths for keywords, these are clickable
64
- (identical? k val)
64
+ (and seq'd-map? ( identical? k val) )
65
65
(present-path-segment k)
66
66
67
67
(identical? v val)
70
70
71
71
(defn build-path-segment [parent-object object]
72
72
(cond
73
- (map? parent-object) (seek-path-segment (seq parent-object) object)
74
- (sequential? parent-object) (seek-path-segment (map-indexed (fn [i x] [i x]) parent-object) object)))
73
+ (map? parent-object) (seek-path-segment (seq parent-object) object true )
74
+ (sequential? parent-object) (seek-path-segment (map-indexed (fn [i x] [i x]) parent-object) object)
75
+ (and (set? parent-object)
76
+ (contains? parent-object object)
77
+ (or (string? object)
78
+ (keyword? object)
79
+ (integer? object))) object ; ; if set has the simple object, return the object instead.
80
+ (and (set? parent-object) ; ; in composite objects in sets, return the index in the set.
81
+ (contains? parent-object object)) (seek-path-segment (map-indexed (fn [i x] [i x]) parent-object) object)))
75
82
76
83
; ; This function checks a unique situation of looping an immediate child element `obj` of a parent element `history`
77
84
; ; say we have a general map {:a 2 :b {:gh 45} :c 4}
You can’t perform that action at this time.
0 commit comments