* Parse each of the given string `args` and convert it to an array if it is of the form * `[abc, def, ghi]`, i.e. it is enclosed in square brackets with comma delimited items. * @param args The string to potentially convert to arrays.
(args: string[])
| 124 | * @param args The string to potentially convert to arrays. |
| 125 | */ |
| 126 | function convertArraysFromArgs(args: string[]): (string | string[])[] { |
| 127 | return args.map((arg) => |
| 128 | arg.startsWith('[') && arg.endsWith(']') |
| 129 | ? arg |
| 130 | .slice(1, -1) |
| 131 | .split(',') |
| 132 | .map((arg) => arg.trim()) |
| 133 | : arg, |
| 134 | ); |
| 135 | } |