(text: string, from: number, limit: number)
| 93 | * the scalar key, tracked by the caller) are still returned; the caller skips |
| 94 | * them. */ |
| 95 | const lineAt = (text: string, from: number, limit: number): LineCursor | null => { |
| 96 | if (from >= limit) return null; |
| 97 | let lineEnd = text.indexOf("\n", from); |
| 98 | if (lineEnd === -1 || lineEnd > limit) lineEnd = limit; |
| 99 | const indent = indentOf(text, from, lineEnd); |
| 100 | const contentStart = from + indent; |
| 101 | return { |
| 102 | lineStart: from, |
| 103 | lineEnd, |
| 104 | nextStart: lineEnd + 1, |
| 105 | indent, |
| 106 | contentStart, |
| 107 | }; |
| 108 | }; |
| 109 | |
| 110 | /** |
| 111 | * Find the start offset of every key line at exactly `indent` within |
no test coverage detected