( params: CliData, reservedKeys: Set<string>, )
| 220 | // execution (quickadd:run can run a Macro choice), so this is not an escalation |
| 221 | // boundary. |
| 222 | function extractVariables( |
| 223 | params: CliData, |
| 224 | reservedKeys: Set<string>, |
| 225 | ): Record<string, unknown> { |
| 226 | const variables: Record<string, unknown> = {}; |
| 227 | |
| 228 | if (typeof params.vars === "string") { |
| 229 | Object.assign(variables, parseVarsJson(params.vars)); |
| 230 | } |
| 231 | |
| 232 | for (const [key, value] of Object.entries(params)) { |
| 233 | if (key.startsWith("value-")) { |
| 234 | const variableName = key.slice(6); |
| 235 | if (variableName) variables[variableName] = value; |
| 236 | continue; |
| 237 | } |
| 238 | |
| 239 | if (reservedKeys.has(key)) continue; |
| 240 | variables[key] = value; |
| 241 | } |
| 242 | |
| 243 | return variables; |
| 244 | } |
| 245 | |
| 246 | function flattenChoices( |
| 247 | choices: IChoice[], |
no test coverage detected