From e4b382044eb64484851331da938f5308c7f7cd79 Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Tue, 7 Jan 2025 22:00:55 +0000 Subject: [PATCH] Add UriTemplate.toString --- src/shared/uriTemplate.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/shared/uriTemplate.ts b/src/shared/uriTemplate.ts index 47671fdd..cd3f46f3 100644 --- a/src/shared/uriTemplate.ts +++ b/src/shared/uriTemplate.ts @@ -30,6 +30,7 @@ export class UriTemplate { ); } } + private readonly template: string; private readonly parts: Array< | string | { name: string; operator: string; names: string[]; exploded: boolean } @@ -37,9 +38,14 @@ export class UriTemplate { constructor(template: string) { UriTemplate.validateLength(template, MAX_TEMPLATE_LENGTH, "Template"); + this.template = template; this.parts = this.parse(template); } + toString(): string { + return this.template; + } + private parse( template: string, ): Array<