Files
twenty/packages/twenty-server/src/utils/trim-and-remove-duplicated-whitespaces-from-string.ts
2025-06-03 15:01:58 +02:00

5 lines
174 B
TypeScript

const MULTIPLE_WHITESPACE_REGEX = /\s+/g;
export const trimAndRemoveDuplicatedWhitespacesFromString = (str: string) =>
str.trim().replace(MULTIPLE_WHITESPACE_REGEX, ' ');