From 000949f3c30c73e645ae91b64f500dd1f02a65d8 Mon Sep 17 00:00:00 2001 From: Yura Dupyn <2153100+omedusyo@users.noreply.github.com> Date: Wed, 22 Apr 2026 18:53:28 +0200 Subject: [PATCH] Region.stringOf --- src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.ts b/src/index.ts index fde615d..c9fe663 100644 --- a/src/index.ts +++ b/src/index.ts @@ -241,6 +241,10 @@ export class SourceRegion { return this.source.sliceByCp(this.span.start.index, this.span.end.index); } + stringOf(span: Span): string { + return this.subRegion(span).toString(); + } + // Returns a Span for the given line (1-based index). getLineSpan(line: number, stripNewlines = true): Span { if (line < this.span.start.line || line > this.span.end.line) {