mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-10-21 11:14:33 +03:00
* 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>
17 lines
357 B
TypeScript
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;
|
|
}
|