(str: string)
| 31 | /* ------------------------------------------------------------------ */ |
| 32 | |
| 33 | function snakeToCamel(str: string): string { |
| 34 | return str.replaceAll(/_([a-z])/g, (_, ch: string) => ch.toUpperCase()); |
| 35 | } |
| 36 | |
| 37 | function camelToSnake(str: string): string { |
| 38 | return str.replaceAll(/[A-Z]/g, (ch: string) => `_${ch.toLowerCase()}`); |
no outgoing calls
no test coverage detected