( args: Record<string, string>, )
| 35 | * Convert kebab-case keys to camelCase. |
| 36 | */ |
| 37 | export function camelCaseArgs( |
| 38 | args: Record<string, string>, |
| 39 | ): Record<string, string> { |
| 40 | const result: Record<string, string> = {}; |
| 41 | for (const [key, value] of Object.entries(args)) { |
| 42 | const camel = key.replace(/-([a-z])/g, (_, c) => c.toUpperCase()); |
| 43 | result[camel] = value; |
| 44 | } |
| 45 | return result; |
| 46 | } |