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

Function getLongestLineIndex

packs/step-parser/src/step-parser.ts:163–175  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

161}
162
163function getLongestLineIndex(code: string) {
164 const newlineRe = /\r\n|\r|\n/;
165 const lines = code.split(newlineRe);
166
167 let longest = 0;
168 lines.forEach((line, i) => {
169 if (lines[longest].length < line.length) {
170 longest = i;
171 }
172 });
173
174 return longest;
175}

Callers 1

parseStepsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected