(mem)
property access
(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.
(mem debug config)Selects in lines { 1 } but not in { 2, 3 }:
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"].
(mem (comp (str "token")) localStorage)Selects in lines { 1 } but not in { 2, 3 }:
const token = localStorage["token"]
const session = localStorage["session"]
const token2 = sessionStorage["token"]Audit inline styling by finding uses of the style property.
(mem style)Selects in lines { 1, 2 } but not in { 3 }:
button.style.color = "red"
card.style = {}
styles.theme = "dark"Arguments
prop
• Identifier: shorthand for (id)
• Pattern: shorthand for (id)
• (id)
• (comp)
• (:into) • (:and) • (:or) • (:not) • (:text) • (:kind) • (:replace) • (:capture)
obj
• Identifier: shorthand for (id)
• Pattern: shorthand for (id)
• (arr) • (bin) • (bool) • (call) • (comp) • (fun) • (id) • (id+) • (jsx) • (mem) • (null) • (num) • (obj) • (of) • (regex) • (regex+) • (str) • (str*) • (str+) • (tpl) • (tpl*) • (:ref) • (:into) • (:and) • (:or) • (:not) • (:text) • (:kind) • (:replace) • (:capture)