(bin) - JavaScript
binary expressions like a + b or a && b
clojure
(bin operator left? right?)Where:
- operator: binary operator token (e.g.,
+,&&,===) * - left: left-hand operand *
- right: right-hand operand *
Matching:
- arithmetic operators, e.g.
a + b - logical operators, e.g.
a && b - comparison operators, e.g.
a === b
Behavior
- The operator must match exactly (e.g.,
==vs===).
Examples
Find string concatenations that build URLs from user input.
clojure
(bin + (str /https?:\/\//) (id userInput))Selects in lines { 1 } but not in { 2, 3 }:
typescript
const url1 = "https://api.example.com/" + userInput
const url2 = "https://api.example.com/" + userId
const url3 = baseUrl + userInputLocate non-strict equality checks against null.
clojure
(bin == _ (null))Selects in lines { 1 } but not in { 2, 3 }:
typescript
if (value == null) { }
if (value === null) { }
if (value == undefined) { }Find guard conditions that combine feature flags with auth checks.
clojure
(bin && (id featureEnabled) (id isAuthenticated))Selects in lines { 1 } but not in { 2, 3 }:
typescript
if (featureEnabled && isAuthenticated) { }
if (featureEnabled || isAuthenticated) { }
if (isAuthenticated && featureEnabled) { }Arguments
operator
- Identifier
Does NOT support: Composition — Free-form Selection — Refinement — Replacement