Skip to content

Commit 8a0d38f

Browse files
committed
fixing the typecheck
1 parent d3babd5 commit 8a0d38f

File tree

8 files changed

+14
-428
lines changed

8 files changed

+14
-428
lines changed

studio/src/app/connect/saved-connection-storage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ApiUser } from "@studio/lib/api/api-database-response";
2-
import { parseSafeJson } from "@libsqlstudio/gui";
2+
import parseSafeJson from "@studio/lib/json-safe";
33

44
export interface DriverDetailField {
55
name: keyof SavedConnectionItemConfigConfig;

studio/src/app/storybook/connection_error/page.tsx

-12
This file was deleted.

studio/src/app/storybook/opacity_loading/page.tsx

-9
This file was deleted.

studio/src/app/storybook/query_progress/page.tsx

-65
This file was deleted.

studio/src/lib/json-safe.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default function parseSafeJson<T = unknown>(
2+
str: string | null | undefined,
3+
defaultValue: T
4+
): T {
5+
if (!str) return defaultValue;
6+
7+
try {
8+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
9+
return JSON.parse(str);
10+
} catch {
11+
return defaultValue;
12+
}
13+
}

studio/src/lib/multiple-query.ts

-77
This file was deleted.

studio/src/lib/sql-execute-helper.ts

-104
This file was deleted.

0 commit comments

Comments
 (0)