mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-05-06 08:47:18 +00:00
d23c2f3b53
Co-authored-by: Pablo F.G <pablo.fernandez@prowler.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
593 B
TypeScript
22 lines
593 B
TypeScript
const PROVIDER_TAB = {
|
|
PROVIDERS: "providers",
|
|
PROVIDER_GROUPS: "provider-groups",
|
|
} as const;
|
|
|
|
type ProviderTab = (typeof PROVIDER_TAB)[keyof typeof PROVIDER_TAB];
|
|
|
|
function isProviderTab(value: string): value is ProviderTab {
|
|
return Object.values(PROVIDER_TAB).includes(value as ProviderTab);
|
|
}
|
|
|
|
function getProviderTab(value: string | string[] | undefined): ProviderTab {
|
|
if (typeof value !== "string") {
|
|
return PROVIDER_TAB.PROVIDERS;
|
|
}
|
|
|
|
return isProviderTab(value) ? value : PROVIDER_TAB.PROVIDERS;
|
|
}
|
|
|
|
export type { ProviderTab };
|
|
export { getProviderTab, PROVIDER_TAB };
|