tuning import. listing, edit
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { string } from "yup";
|
||||
|
||||
export function clearTag(htmlString: string | undefined) {
|
||||
return htmlString?.replace(/(<([^>]+)>)/gi, "");
|
||||
}
|
||||
@@ -9,3 +11,9 @@ export function limitString(anyString: string | undefined, limit: number = 50) {
|
||||
export function makeExcerpt(htmlString: string | undefined, limit: number = 50) {
|
||||
return limitString(clearTag(htmlString ?? ''), limit);
|
||||
}
|
||||
|
||||
export function capitalizeFirstLetter(text: string) {
|
||||
return text.charAt(0).toUpperCase() + text.slice(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user