Function
indentOf
(text: string, lineStart: number, lineEnd: number)
Source from the content-addressed store, hash-verified
| 64 | |
| 65 | /** Count of leading spaces on the line starting at `lineStart`. */ |
| 66 | const indentOf = (text: string, lineStart: number, lineEnd: number): number => { |
| 67 | let i = lineStart; |
| 68 | while (i < lineEnd && text.charCodeAt(i) === SPACE) i++; |
| 69 | return i - lineStart; |
| 70 | }; |
| 71 | |
| 72 | /** True for a blank (whitespace-only) or comment line. */ |
| 73 | const isBlankOrComment = (text: string, contentStart: number, lineEnd: number): boolean => |
Tested by
no test coverage detected