Skip to content

fix(web): remove redundant truthiness check (CodeQL js/trivial-conditional)#56

Merged
Musiker15 merged 1 commit into
mainfrom
fix/codeql-trivial-conditional
Jun 20, 2026
Merged

fix(web): remove redundant truthiness check (CodeQL js/trivial-conditional)#56
Musiker15 merged 1 commit into
mainfrom
fix/codeql-trivial-conditional

Conversation

@Musiker15

Copy link
Copy Markdown
Member

Resolves the open code scanning alert js/trivial-conditional in apps/web/src/app/api/forms/[slug]/submit/route.ts:34.

In buildPreview's valueOf, null/undefined/"" are returned earlier, so by the object branch value is always truthy — the && value was a useless conditional. Dropped it; typeof value === "object" && "name" in value is sufficient and still type-checks (the earlier null exclusion narrows unknown).

Verification

  • pnpm typecheck ✅ · pnpm lint

…ional)

In buildPreview's valueOf, null/undefined are already returned earlier, so the
'&& value' in the object branch always evaluates to true. Drop it; the plain
typeof + 'name' in value check is sufficient and still type-checks.
@Musiker15 Musiker15 merged commit 11e9b93 into main Jun 20, 2026
3 checks passed
@Musiker15 Musiker15 deleted the fix/codeql-trivial-conditional branch June 20, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant