export const toCamelCase = (text: string): string =>
text.replace(/-(?<letter>[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
}
export const stripTags = (text: string): string =>
text
.replace(/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi, '')
.replace(/<\/?[a-z][a-z0-9]*\b[^>]*>/gi, '')
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| snippets/ | 2026-07-30 21:37 | 6.43 KB | 76129f60960:kunden | dxwrx-r--r | |
| Linter.ts | 2026-07-30 21:37 | 4.44 KB | 76129f60960:kunden | -xw-x----- | |
| errors.ts | 2026-07-30 21:37 | 80 B | 76129f60960:kunden | -xw-x----- | |
| files.ts | 2026-07-30 21:37 | 1.44 KB | 76129f60960:kunden | -xw-x----- | |
| hooks.ts | 2026-07-30 21:37 | 498 B | 76129f60960:kunden | -xw-x----- | |
| restAPI.ts | 2026-07-30 21:37 | 473 B | 76129f60960:kunden | -xw-x----- | |
| screen.ts | 2026-07-30 21:37 | 249 B | 76129f60960:kunden | -xw-x----- | |
| text.ts | 2026-07-30 21:37 | 787 B | 76129f60960:kunden | -xw-x----- | |