254
255
export function splitLinesIncludeSeparators(str: string): string[] {
256
>
const linesWithSeparators: string[] = [];
strings.ts
257
>
const splitLinesAndSeparators = str.split(/(\r\n|\r|\n)/);
258
>
for (let i = 0; i < Math.ceil(splitLinesAndSeparators.length / 2); i++) {
259
>
linesWithSeparators.push(splitLinesAndSeparators[2 * i] + (splitLinesAndSeparators[2 * i + 1] ?? ''));
260
>
}
261
>
return linesWithSeparators;
262
>
}
263
264
export function indexOfPattern(str: string, re: RegExp) {