| 1 |
export const toCamelCase = (text: string): string => |
| 2 |
text.replace(/-(?<letter>[a-z])/g, (_, letter: string) => letter.toUpperCase()) |
| 3 |
|
| 4 |
export const trimLeadingChar = (text: string, character: string): string => |
| 5 |
character === text.charAt(0) ? text.slice(1) : text |
| 6 |
|
| 7 |
export const trimTrailingChar = (text: string, character: string): string => |
| 8 |
character === text.charAt(text.length - 1) ? text.slice(0, -1) : text |
| 9 |
|