MCPcopy Create free account
hub / github.com/cursorless-dev/cursorless / ensureSingleTarget

Function ensureSingleTarget

src/util/targetUtils.ts:19–25  ·  view source on GitHub ↗
(targets: TypedSelection[])

Source from the content-addressed store, hash-verified

17}
18
19export function ensureSingleTarget(targets: TypedSelection[]) {
20 if (targets.length !== 1) {
21 throw new Error("Can only have one target with this action");
22 }
23
24 return targets[0];
25}
26
27export async function runForEachEditor<T, U>(
28 targets: T[],

Callers 4

runMethod · 0.90
runMethod · 0.90
runMethod · 0.90
runMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected