## 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
17 lines
364 B
TypeScript
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}`;
|
|
};
|