Add UriTemplate.toString

This commit is contained in:
Justin Spahr-Summers 2025-01-07 22:00:55 +00:00
commit e4b382044e
No known key found for this signature in database

View file

@ -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<