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

Function getDefaultFocus

packs/step-parser/src/step-parser.ts:146–161  ·  view source on GitHub ↗
(prevLineKeys: number[], lineKeys: number[])

Source from the content-addressed store, hash-verified

144}
145
146function getDefaultFocus(prevLineKeys: number[], lineKeys: number[]) {
147 const focus = {} as Record<number, true>;
148 lineKeys.forEach((lineKey, lineIndex) => {
149 if (!prevLineKeys.includes(lineKey)) {
150 focus[lineIndex] = true;
151 }
152 });
153
154 if (Object.keys(focus).length === 0) {
155 lineKeys.forEach((_, lineIndex) => {
156 focus[lineIndex] = true;
157 });
158 }
159
160 return focus;
161}
162
163function getLongestLineIndex(code: string) {
164 const newlineRe = /\r\n|\r|\n/;

Callers 1

parseStepsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected