mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-28 03:41:48 +08:00
dbeaver/pro#6364 refactor: update types for better usage (its strange to compare two values with different types)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2024 DBeaver Corp and others
|
||||
* Copyright (C) 2020-2025 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -8,7 +8,9 @@
|
||||
import type { NavigatorSettingsInput } from '@cloudbeaver/core-sdk';
|
||||
|
||||
export type NavigatorView = 'simple' | 'advanced';
|
||||
export type NavigatorViewSettings = Partial<NavigatorSettingsInput>;
|
||||
export type NavigatorViewSettings = Omit<NavigatorSettingsInput, 'showSystemObjects'> & {
|
||||
showSystemObjects?: boolean;
|
||||
};
|
||||
|
||||
export const CONNECTION_NAVIGATOR_VIEW_SETTINGS: Record<NavigatorView, NavigatorViewSettings> = {
|
||||
simple: {
|
||||
@@ -29,6 +31,6 @@ export const CONNECTION_NAVIGATOR_VIEW_SETTINGS: Record<NavigatorView, Navigator
|
||||
},
|
||||
};
|
||||
|
||||
export function isNavigatorViewSettingsEqual(settings: NavigatorSettingsInput, settingsToCompare: NavigatorViewSettings): boolean {
|
||||
return !(Object.keys(settingsToCompare) as Array<keyof NavigatorSettingsInput>).some(key => settings[key] !== settingsToCompare[key]);
|
||||
export function isNavigatorViewSettingsEqual(settings: NavigatorViewSettings, settingsToCompare: NavigatorViewSettings): boolean {
|
||||
return !(Object.keys(settingsToCompare) as Array<keyof NavigatorViewSettings>).some(key => settings[key] !== settingsToCompare[key]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user