Add accessor method to retrieve array filter value from EntityTypeFilter
Co-authored-by: Tim Hansen <timbonicus@gmail.com> Co-authored-by: Chase Rutherford-Jenkins <chaseajen@users.noreply.github.com> Co-authored-by: Himanshu Mishra <himanshum@spotify.com> Co-authored-by: Joe Porpeglia <josephp@spotify.com> Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
@@ -32,10 +32,14 @@ export class EntityKindFilter implements EntityFilter {
|
||||
}
|
||||
|
||||
export class EntityTypeFilter implements EntityFilter {
|
||||
constructor(readonly value: string) {}
|
||||
constructor(readonly value: string | string[]) {}
|
||||
|
||||
getTypes() {
|
||||
return Array.isArray(this.value) ? this.value : [this.value];
|
||||
}
|
||||
|
||||
getCatalogFilters(): Record<string, string | string[]> {
|
||||
return { 'spec.type': this.value };
|
||||
return { 'spec.type': this.getTypes() };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user