YaroslavBerkuta
9 months ago
2 changed files with 11 additions and 17 deletions
@ -1,12 +1,12 @@
@@ -1,12 +1,12 @@
|
||||
export const cutLongText = (txt: string, length: number): string => { |
||||
if (txt.length > length) { |
||||
const cuttingTxt = txt.slice(0, length) |
||||
if (txt.length > length) { |
||||
const cuttingTxt = txt.slice(0, length) |
||||
|
||||
return `${cuttingTxt}...` |
||||
} |
||||
return `${cuttingTxt}...` |
||||
} |
||||
|
||||
return txt |
||||
return txt |
||||
} |
||||
|
||||
export const getLinksFromTxt = (txt: string) => |
||||
txt?.match(/\bhttp(s)?:(:)?\/\/\S+/gi) |
||||
txt?.match(/\bhttp(s)?:(:)?\/\/\S+/gi) |
||||
|
Loading…
Reference in new issue