prettier...

Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com>
This commit is contained in:
Brian Phillips
2023-03-15 11:26:35 -05:00
parent fc6cab4eb4
commit da16cb6994
2 changed files with 7 additions and 5 deletions
@@ -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();
});
});
@@ -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