Files
Homarr/packages/common/src/string.ts
2025-01-30 20:15:05 +01:00

8 lines
261 B
TypeScript

export const capitalize = <T extends string>(str: T) => {
return (str.charAt(0).toUpperCase() + str.slice(1)) as Capitalize<T>;
};
export const isNullOrWhitespace = (value: string | null): value is null => {
return value == null || value.trim() === "";
};