MCPcopy
hub / github.com/antonmedv/codejar / findPadding

Function findPadding

codejar.ts:531–540  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

529 }
530
531 function findPadding(text: string): [string, number, number] {
532 // Find beginning of previous line.
533 let i = text.length - 1
534 while (i >= 0 && text[i] !== '\n') i--
535 i++
536 // Find padding of the line.
537 let j = i
538 while (j < text.length && /[ \t]/.test(text[j])) j++
539 return [text.substring(i, j) || '', i, j]
540 }
541
542 function toString() {
543 return editor.textContent || ''

Callers 2

handleNewLineFunction · 0.85
handleTabCharactersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected