(args: string[])
| 19 | } |
| 20 | |
| 21 | export function parseReplayOpenFlags(args: string[]): { |
| 22 | positionals: string[]; |
| 23 | flags: SessionAction['flags']; |
| 24 | runtime?: SessionAction['runtime']; |
| 25 | } { |
| 26 | const argsWithoutRelaunch: string[] = []; |
| 27 | const flags: SessionAction['flags'] = {}; |
| 28 | for (const token of args) { |
| 29 | if (token === '--relaunch') { |
| 30 | flags.relaunch = true; |
| 31 | continue; |
| 32 | } |
| 33 | argsWithoutRelaunch.push(token); |
| 34 | } |
| 35 | const parsedRuntime = parseReplayRuntimeFlags(argsWithoutRelaunch); |
| 36 | return { |
| 37 | positionals: parsedRuntime.positionals, |
| 38 | flags, |
| 39 | runtime: hasReplayOpenRuntimeHints(parsedRuntime.flags) ? parsedRuntime.flags : undefined, |
| 40 | }; |
| 41 | } |
| 42 | |
| 43 | function hasReplayOpenRuntimeHints( |
| 44 | flags: ReturnType<typeof parseReplayRuntimeFlags>['flags'], |
no test coverage detected