forked from github/plane
fix: truncate text function (#431)
This commit is contained in:
parent
d6d51c2f43
commit
3f5bbf336c
@ -4,8 +4,11 @@ export const replaceUnderscoreIfSnakeCase = (str: string) => str.replace(/_/g, "
|
||||
|
||||
export const capitalizeFirstLetter = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
|
||||
|
||||
export const truncateText = (str: string, length: number) =>
|
||||
str.length > length ? `${str.substring(0, length)}...` : str;
|
||||
export const truncateText = (str: string, length: number) => {
|
||||
if (!str || str === "") return "";
|
||||
|
||||
return str.length > length ? `${str.substring(0, length)}...` : str;
|
||||
};
|
||||
|
||||
export const createSimilarString = (str: string) => {
|
||||
const shuffled = str
|
||||
|
Loading…
Reference in New Issue
Block a user