Add UriTemplate.toString
This commit is contained in:
parent
1e040e9932
commit
e4b382044e
1 changed files with 6 additions and 0 deletions
|
|
@ -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<
|
||||
|
|
|
|||
Loading…
Reference in a new issue