@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog': minor
|
||||
---
|
||||
|
||||
Add `isApiType()` to EntitySwitch routing functions.
|
||||
@@ -559,6 +559,11 @@ export interface HasSystemsCardProps {
|
||||
variant?: InfoCardVariants;
|
||||
}
|
||||
|
||||
// @public
|
||||
export function isApiType(
|
||||
types: string | string[],
|
||||
): (entity: Entity) => boolean;
|
||||
|
||||
// @public
|
||||
export function isComponentType(
|
||||
types: string | string[],
|
||||
|
||||
@@ -60,6 +60,14 @@ export function isResourceType(types: string | string[]) {
|
||||
return isEntityWith({ kind: 'resource', type: types });
|
||||
}
|
||||
|
||||
/**
|
||||
* For use in EntitySwitch.Case. Matches if the entity is an API of a given spec.type.
|
||||
* @public
|
||||
*/
|
||||
export function isApiType(types: string | string[]) {
|
||||
return isEntityWith({ kind: 'api', type: types });
|
||||
}
|
||||
|
||||
/**
|
||||
* For use in EntitySwitch.Case. Matches if the entity is the specified kind and type (if present).
|
||||
* @public
|
||||
|
||||
@@ -22,5 +22,6 @@ export {
|
||||
isNamespace,
|
||||
isComponentType,
|
||||
isResourceType,
|
||||
isApiType,
|
||||
isEntityWith,
|
||||
} from './conditions';
|
||||
|
||||
Reference in New Issue
Block a user