(text: string, lineStart: number, lineEnd: number)
| 148 | |
| 149 | /** The simple (unquoted) key name on a key line, e.g. `paths`, `schemas`. */ |
| 150 | const keyNameAt = (text: string, lineStart: number, lineEnd: number): string => { |
| 151 | const indent = indentOf(text, lineStart, lineEnd); |
| 152 | const colon = text.indexOf(":", lineStart + indent); |
| 153 | const keyEnd = colon === -1 || colon > lineEnd ? lineEnd : colon; |
| 154 | return text.slice(lineStart + indent, keyEnd).trim(); |
| 155 | }; |
| 156 | |
| 157 | /** |
| 158 | * Scan a document into its structural ranges. Pure and synchronous; never |
no test coverage detected