MCPcopy Create free account
hub / github.com/AdbAutoPlayer/AdbAutoPlayer / capitalize

Function capitalize

src/lib/utils/string.ts:12–15  ·  view source on GitHub ↗
(str: string | null | undefined)

Source from the content-addressed store, hash-verified

10 * capitalize(undefined) // ''
11 */
12export function capitalize(str: string | null | undefined): string {
13 if (!str) return "";
14 return str.charAt(0).toUpperCase() + str.slice(1);
15}
16
17/**
18 * Safely capitalizes an error (or any value) after converting to string.

Callers 1

capitalizeErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected