redux-devtools/packages/redux-devtools-rtk-query-monitor/src/utils/tabs.ts
renovate[bot] 922985f9ea
chore(deps): update dependency prettier to v3 (#1434)
* chore(deps): update dependency prettier to v3

* Format

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-07-12 18:03:20 +00:00

17 lines
357 B
TypeScript

import { TabOption } from '../types';
export function isTabVisible<St, Props, Vis extends string>(
tab: TabOption<St, Props, Vis>,
visKey: Vis | 'default',
): boolean {
if (typeof tab.visible === 'boolean') {
return tab.visible;
}
if (typeof tab.visible === 'object' && tab.visible) {
return !!tab.visible[visKey];
}
return true;
}