Skip to content

Commit d979551

Browse files
committed
fixed lint
1 parent c240538 commit d979551

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/utils/helpers.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,15 @@ export const renderJSON = (obj: unknown) =>
7474
export const renderMaybeParsedJSON = (value: unknown): string => {
7575
if (value == null) return renderJSON(value);
7676

77-
if (typeof value === "object" && "message" in value && typeof (value as any).message === "string") {
77+
if (
78+
typeof value === "object" &&
79+
value !== null &&
80+
"message" in value &&
81+
typeof (value as Record<string, unknown>).message === "string"
82+
) {
7883
const obj = value as { message: string };
79-
8084
try {
8185
const parsed = JSON.parse(obj.message);
82-
8386
return renderJSON({ ...value, message: parsed });
8487
} catch {
8588
return renderJSON(value);

0 commit comments

Comments
 (0)