Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/opencode/src/util/locale.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export namespace Locale {
export function titlecase(str: string) {
export function titlecase(str?: string | null) {
if (!str) return ""
Comment on lines +2 to +3
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new null/undefined handling behavior for the titlecase function is not covered by tests. Consider adding test cases to verify the function correctly returns an empty string when passed undefined, null, or empty string values. This would prevent regression and document the intended behavior.

Copilot uses AI. Check for mistakes.
return str.replace(/\b\w/g, (c) => c.toUpperCase())
}

Expand Down
Loading