(mem) - JavaScript
property access
clojure
(mem prop? obj?)Where:
- prop: property name or computed key (the
bina.bor theexprina[expr]) * - obj: value being accessed (the
aina.b) *
Matching:
- dot access, e.g.
a.b - computed access, e.g.
a[expr] - private fields, e.g.
a.#field
Examples
Remove a deprecated debug flag by finding reads of config.debug.
clojure
(mem debug config)Selects in lines { 1 } but not in { 2, 3 }:
typescript
if (config.debug) { log("debug") }
if (config.verbose) { log("debug") }
if (settings.debug) { log("debug") }Migrate storage keys by finding direct access to localStorage["token"].
clojure
(mem (comp (str "token")) localStorage)Selects in lines { 1 } but not in { 2, 3 }:
typescript
const token = localStorage["token"]
const session = localStorage["session"]
const token2 = sessionStorage["token"]Audit inline styling by finding uses of the style property.
clojure
(mem style)Selects in lines { 1, 2 } but not in { 3 }:
typescript
button.style.color = "red"
card.style = {}
styles.theme = "dark"Arguments
prop
- Identifier: shorthand for (id)
- Pattern: shorthand for (id)
- (id)
- (comp)
- (:into)
- (:nearest)
- (:and)
- (:or)
- (:not)
- (:text)
- (:kind)
- (:replace)
- (:replace-in)
- (:capture)