/home/vianto5/realtylifestyleproperties.mx/wp-content/plugins/code-snippets/js/utils
NameSizeModeActions
errors.ts800644editdlrm
files.ts11100644editdlrm
general.ts2490644editdlrm
Linter.ts45450644editdlrm
restAPI.ts7930644editdlrm
shortcodes.ts3460644editdlrm
snippets.ts9680644editdlrm
text.ts6230644editdlrm
Edit: /home/vianto5/realtylifestyleproperties.mx/wp-content/plugins/code-snippets/js/utils/text.ts (623B)
export const toCamelCase = (text: string): string => text.replace(/-(?[a-z])/g, (_, letter: string) => letter.toUpperCase()) export const trimLeadingChar = (text: string, character: string): string => character === text.charAt(0) ? text.slice(1) : text export const trimTrailingChar = (text: string, character: string): string => character === text.charAt(text.length - 1) ? text.slice(0, -1) : text export const truncateWords = (text: string, wordCount: number): string => { const words = text.trim().split(/\s+/) return words.length > wordCount ? `${words.slice(0, wordCount).join(' ')}…` : text }