Files
zerobyte/app/server/utils/json.ts
Nico 2ab37e6b67 refactor: async doctor (#375)
* feat: background doctor operation

* refactor(repo-details): design layout

* refactor(doctor): support abort signal in all operations

* chore: fix linting issue

* chore: pr feedbacks

* chore: merge conflicts

* refactor: handle aborted signal in all operations

* chore: pr feedbacks

* chore: remove old migration
2026-01-22 21:55:45 +01:00

12 lines
184 B
TypeScript

export function safeJsonParse<T>(input: string | null | undefined): T | null {
if (!input) {
return null;
}
try {
return JSON.parse(input) as T;
} catch {
return null;
}
}