Files
twenty/packages/twenty-shared/src/utils/strings/appendCopySuffix.ts
T
Raphaël BosiandGitHub 5af2d37253 [DASHBOARDS] Dashboard duplication (#16291)
## Description

- Created a Dashboard duplication action
- Created a new duplication custom resolver
- Created the service using the v2 of the API
- Created the integration tests following the v2 methodology

## Video QA


https://github.com/user-attachments/assets/e409951a-5946-4da0-91a0-1f7d2ecadb08
2025-12-11 11:15:15 +00:00

17 lines
364 B
TypeScript

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}`;
};