mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
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 capitalizeFirstLetter = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
|
||||||
|
|
||||||
export const truncateText = (str: string, length: number) =>
|
export const truncateText = (str: string, length: number) => {
|
||||||
str.length > length ? `${str.substring(0, length)}...` : str;
|
if (!str || str === "") return "";
|
||||||
|
|
||||||
|
return str.length > length ? `${str.substring(0, length)}...` : str;
|
||||||
|
};
|
||||||
|
|
||||||
export const createSimilarString = (str: string) => {
|
export const createSimilarString = (str: string) => {
|
||||||
const shuffled = str
|
const shuffled = str
|
||||||
|
Loading…
Reference in New Issue
Block a user