Skip to content

(:or)

logical OR - matches when any nested selector matches (union)

clojure
(:or selector selector [selector...])

Where:

  1. selector: selectors where at least one must match *

Examples

Find property access to either deprecated or legacy field names.

clojure
(mem (:or legacyId deprecatedName) user)

Selects in lines { 1, 2 } but not in { 3 }:

typescript
user.legacyId
user.deprecatedName
user.currentId

Locate arrays or objects as function arguments.

clojure
(call process (arg 1 (:or (arr) (obj))))

Selects in lines { 1, 2 } but not in { 3 }:

typescript
process([1, 2, 3])
process({ key: 'value' })
process('string')

Match string literals in single quotes, double quotes, or templates.

clojure
(:or (str "api") (tpl /api/))

Selects in lines { 1, 2, 3 } but not in { 4 }:

typescript
const url1 = 'api/users'
const url2 = "api/posts"
const url3 = `api/${endpoint}`
const url4 = 'web/users'

Arguments

selector

inherit

Copyright © 2022-present Semantic Works, Inc.