(
task: T,
options: { omitDescription?: boolean } = {}
)
| 188 | for (const character of value) { |
| 189 | sourceOffset += character.length; |
| 190 | if (/\s/u.test(character)) { |
| 191 | if (compacted.length > 0) { |
| 192 | hasPendingWhitespace = true; |
| 193 | pendingWhitespaceEnd = sourceOffset; |
| 194 | } |
| 195 | continue; |
| 196 | } |
| 197 | |
| 198 | if (hasPendingWhitespace) { |
| 199 | compacted += ' '; |
| 200 | sourceEndOffsets.push(pendingWhitespaceEnd); |
| 201 | hasPendingWhitespace = false; |
| 202 | } |
| 203 | compacted += character; |
| 204 | for (let index = 0; index < character.length; index += 1) { |
| 205 | sourceEndOffsets.push(sourceOffset); |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | return { value: compacted, sourceEndOffsets }; |
| 210 | } |
| 211 | |
| 212 | function getTitleSeparatorLength(remainder: string): number { |
| 213 | const lineSeparator = remainder.match(/^[ \t]*(?:\r\n|\r|\n)/u); |
| 214 | if (lineSeparator) { |
| 215 | return lineSeparator[0].length; |
| 216 | } |
| 217 | return /^[ \t]/u.test(remainder) ? 1 : 0; |
| 218 | } |
no test coverage detected