Files
pulse/frontend-modern/src/utils/stringUtils.ts
T
2026-03-19 08:42:05 +00:00

6 lines
210 B
TypeScript

export const asTrimmedString = (value: unknown): string | undefined => {
if (typeof value !== 'string') return undefined;
const trimmed = value.trim();
return trimmed.length > 0 ? trimmed : undefined;
};