twenty / packages /twenty-shared /src /utils /strings /appendCopySuffix.ts
Jules
Initial clean CRM deployment with prebuilt assets
d9494a5
Raw
History Blame Contribute Delete
364 Bytes
import { isNonEmptyString } from '@sniptt/guards';
const COPY_SUFFIX = '(Copy)';
const COPY_SUFFIX_LOWERCASE = '(copy)';
export const appendCopySuffix = (value: string): string => {
if (!isNonEmptyString(value)) {
return value;
}
if (value.toLowerCase().endsWith(COPY_SUFFIX_LOWERCASE)) {
return value;
}
return `${value} ${COPY_SUFFIX}`;
};