From da16cb69945255e28766179d36dabb9c2a65fc29 Mon Sep 17 00:00:00 2001 From: Brian Phillips <28457+brianphillips@users.noreply.github.com> Date: Wed, 15 Mar 2023 11:26:35 -0500 Subject: [PATCH] prettier... Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com> --- .../src/components/EntitySwitch/conditions.test.ts | 4 ++-- plugins/catalog/src/components/EntitySwitch/conditions.ts | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/catalog/src/components/EntitySwitch/conditions.test.ts b/plugins/catalog/src/components/EntitySwitch/conditions.test.ts index a0485c6a59..76e9e7a7a8 100644 --- a/plugins/catalog/src/components/EntitySwitch/conditions.test.ts +++ b/plugins/catalog/src/components/EntitySwitch/conditions.test.ts @@ -135,11 +135,11 @@ describe('isComponentType', () => { describe('isEntityWith', () => { it('allows for a kind-only check (empty type array)', () => { - const checkEntity = isEntityWith({kind: 'api', type: []}); + const checkEntity = isEntityWith({ kind: 'api', type: [] }); expect(checkEntity(apiKind)).toBeTruthy(); }); it('handles missing spec.type field', () => { - const checkEntity = isEntityWith({kind: 'another-type', type: 'service'}); + const checkEntity = isEntityWith({ kind: 'another-type', type: 'service' }); expect(checkEntity(missingSpecType)).not.toBeTruthy(); }); }); diff --git a/plugins/catalog/src/components/EntitySwitch/conditions.ts b/plugins/catalog/src/components/EntitySwitch/conditions.ts index 0ffd9c0b01..5442a955ae 100644 --- a/plugins/catalog/src/components/EntitySwitch/conditions.ts +++ b/plugins/catalog/src/components/EntitySwitch/conditions.ts @@ -38,7 +38,7 @@ function strCmpAll(value: string | undefined, cmpValues: string | string[]) { * @public */ export function isKind(kinds: string | string[]) { - return isEntityWith({kind: kinds}); + return isEntityWith({ kind: kinds }); } /** @@ -68,7 +68,10 @@ export function isEntityWith(predicate: EntityPredicates) { return false; } - if (!predicate.type || (Array.isArray(predicate.type) && predicate.type.length === 0)) { + if ( + !predicate.type || + (Array.isArray(predicate.type) && predicate.type.length === 0) + ) { // there's no type check, return true return true; } else if (typeof entity.spec?.type !== 'string') { @@ -80,7 +83,6 @@ export function isEntityWith(predicate: EntityPredicates) { }; } - /** * For use in EntitySwitch.Case. Matches if the entity is in a given namespace. * @public