feat: add variableNames for UriTemplate
This commit is contained in:
parent
0fa2397174
commit
670d98863d
1 changed files with 23 additions and 2 deletions
|
|
@ -36,6 +36,10 @@ export class UriTemplate {
|
|||
| { name: string; operator: string; names: string[]; exploded: boolean }
|
||||
>;
|
||||
|
||||
get variableNames(): string[] {
|
||||
return this.parts.flatMap((part) => typeof part === 'string' ? [] : part.names);
|
||||
}
|
||||
|
||||
constructor(template: string) {
|
||||
UriTemplate.validateLength(template, MAX_TEMPLATE_LENGTH, "Template");
|
||||
this.template = template;
|
||||
|
|
|
|||
Loading…
Reference in a new issue