From 2c2a7d06d1f38248e1d3d6db8b933843d2e34619 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 6 Jan 2026 20:00:18 +0000 Subject: [PATCH] Fix strict-boolean-expressions and type safety warnings in production code Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- .../src/lib/db/functions/comments/crud/add-comment.ts | 2 +- .../lib/db/functions/comments/crud/get-comments.ts | 4 ++-- .../lib/db/functions/comments/crud/set-comments.ts | 2 +- .../components/hierarchy/get-component-configs.ts | 11 ++++++----- .../components/hierarchy/get-component-hierarchy.ts | 4 ++-- .../src/lib/github/parse-workflow-run-logs-options.ts | 3 ++- .../nextjs/src/lib/github/resolve-github-repo.ts | 11 ++++++++--- frontends/nextjs/src/types/monaco-editor-react.d.ts | 1 - 8 files changed, 22 insertions(+), 16 deletions(-) diff --git a/frontends/nextjs/src/lib/db/functions/comments/crud/add-comment.ts b/frontends/nextjs/src/lib/db/functions/comments/crud/add-comment.ts index 2917b4b88..b9cfaedb5 100644 --- a/frontends/nextjs/src/lib/db/functions/comments/crud/add-comment.ts +++ b/frontends/nextjs/src/lib/db/functions/comments/crud/add-comment.ts @@ -17,7 +17,7 @@ export const addComment = async (comment: Comment): Promise => { userId: comment.userId, content: comment.content, createdAt: BigInt(comment.createdAt), - updatedAt: comment.updatedAt ? BigInt(comment.updatedAt) : null, + updatedAt: comment.updatedAt !== null && comment.updatedAt !== undefined ? BigInt(comment.updatedAt) : null, parentId: comment.parentId, }, }) diff --git a/frontends/nextjs/src/lib/db/functions/comments/crud/get-comments.ts b/frontends/nextjs/src/lib/db/functions/comments/crud/get-comments.ts index 8e0ce3a15..3d558916c 100644 --- a/frontends/nextjs/src/lib/db/functions/comments/crud/get-comments.ts +++ b/frontends/nextjs/src/lib/db/functions/comments/crud/get-comments.ts @@ -19,7 +19,7 @@ export const getComments = async (): Promise => { entityId: c.entityId, content: c.content, createdAt: Number(c.createdAt), - updatedAt: c.updatedAt ? Number(c.updatedAt) : undefined, - parentId: c.parentId || undefined, + updatedAt: c.updatedAt !== null && c.updatedAt !== undefined ? Number(c.updatedAt) : undefined, + parentId: c.parentId !== null && c.parentId !== '' ? c.parentId : undefined, })) } diff --git a/frontends/nextjs/src/lib/db/functions/comments/crud/set-comments.ts b/frontends/nextjs/src/lib/db/functions/comments/crud/set-comments.ts index 49a4a60bd..5ab0dc791 100644 --- a/frontends/nextjs/src/lib/db/functions/comments/crud/set-comments.ts +++ b/frontends/nextjs/src/lib/db/functions/comments/crud/set-comments.ts @@ -19,7 +19,7 @@ export const setComments = async (comments: Comment[]): Promise => { userId: comment.userId, content: comment.content, createdAt: BigInt(comment.createdAt), - updatedAt: comment.updatedAt ? BigInt(comment.updatedAt) : null, + updatedAt: comment.updatedAt !== null && comment.updatedAt !== undefined ? BigInt(comment.updatedAt) : null, parentId: comment.parentId, }, }) diff --git a/frontends/nextjs/src/lib/db/functions/components/hierarchy/get-component-configs.ts b/frontends/nextjs/src/lib/db/functions/components/hierarchy/get-component-configs.ts index 0afdcd7c5..f60839e1e 100644 --- a/frontends/nextjs/src/lib/db/functions/components/hierarchy/get-component-configs.ts +++ b/frontends/nextjs/src/lib/db/functions/components/hierarchy/get-component-configs.ts @@ -5,6 +5,7 @@ import { prisma } from '@/lib/config/prisma' import type { ComponentConfig } from './types' +import type { JsonValue } from '@/types/utility-types' /** * Get all component configs @@ -17,11 +18,11 @@ export const getComponentConfigs = async (): Promise, + styles: JSON.parse(config.styles) as Record, + events: JSON.parse(config.events) as Record, + conditionalRendering: config.conditionalRendering !== null && config.conditionalRendering !== '' + ? JSON.parse(config.conditionalRendering) as { condition: string; luaScriptId?: string } : undefined, } } diff --git a/frontends/nextjs/src/lib/db/functions/components/hierarchy/get-component-hierarchy.ts b/frontends/nextjs/src/lib/db/functions/components/hierarchy/get-component-hierarchy.ts index 6e6cbcc37..e145c75b8 100644 --- a/frontends/nextjs/src/lib/db/functions/components/hierarchy/get-component-hierarchy.ts +++ b/frontends/nextjs/src/lib/db/functions/components/hierarchy/get-component-hierarchy.ts @@ -17,8 +17,8 @@ export const getComponentHierarchy = async (): Promise }