MCPcopy Index your code
hub / github.com/pomber/code-surfer / parseFocus

Function parseFocus

packs/step-parser/src/focus-parser.ts:7–19  ·  view source on GitHub ↗
(focus: string)

Source from the content-addressed store, hash-verified

5type ColumnIndex = number;
6
7export function parseFocus(focus: string) {
8 if (!focus) {
9 throw new Error("Focus cannot be empty");
10 }
11
12 try {
13 const parts = focus.split(/,(?![^\[]*\])/g).map(parsePart);
14 return fromEntries(flat(parts));
15 } catch (error) {
16 // TODO enhance error
17 throw error;
18 }
19}
20
21type Part = [LineIndex, true | ColumnIndex[]];
22

Callers 3

runParseFocusFunction · 0.90
parseStepsFunction · 0.90

Calls 2

fromEntriesFunction · 0.90
mapMethod · 0.45

Tested by 1

runParseFocusFunction · 0.72