(is)
kind constraints for functions and variable declarations
clojure
(is kind)Where:
- kind: kind to match *
Matching:
- async functions, e.g.
async function x() {} - generator functions, e.g.
function* x() {} - const declarations, e.g.
const x = 1 - let declarations, e.g.
let x = 1 - var declarations, e.g.
var x = 1
Examples
Audit async functions before changing error handling.
clojure
(fun _ _ (is async))Selects in lines { 1, 2 } but not in { 3 }:
typescript
async function load() {}
const run = async () => {}
function sync() {}Find generator utilities to replace with async iterators.
clojure
(fun _ _ (is generator))Selects in lines { 1, 2 } but not in { 3 }:
typescript
function* ids() { yield 1 }
const gen = function* () { yield 2 }
function ids() { return [1] }Locate const declarations that should be migrated to let.
clojure
(var _ _ (is const))Selects in lines { 1 } but not in { 2, 3 }:
typescript
const token = "abc"
let retries = 3
var legacy = 1Arguments
kind
• "async"
• "generator"
• "var"
• "let"
• "const"
Does NOT support: Composition — Free-form Selection — Refinement — Replacement