Skip to content

Commit 8df6b31

Browse files
fix(benchmarks): accept --mode=value and own-property mode lookup
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 8b11235 commit 8df6b31

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

benchmarks/sandbox/tti.bench.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,12 @@ const MODES: Record<'sequential' | 'staggered' | 'burst', TtiModePreset> = {
8181

8282
type TtiMode = keyof typeof MODES;
8383

84+
/** Accepts both `--mode burst` and `--mode=burst`, as the runner's own flags do. */
8485
function parseMode(argv: string[]): TtiMode {
86+
const inline = argv.find((a) => a.startsWith('--mode='));
8587
const idx = argv.indexOf('--mode');
86-
const value = idx !== -1 && idx + 1 < argv.length ? argv[idx + 1] : 'sequential';
87-
if (!(value in MODES)) {
88+
const value = inline !== undefined ? inline.slice('--mode='.length) : idx !== -1 ? argv[idx + 1] : 'sequential';
89+
if (value === undefined || !Object.hasOwn(MODES, value)) {
8890
console.error(`Invalid --mode "${value}". Valid modes: ${Object.keys(MODES).join(', ')}`);
8991
process.exit(1);
9092
}

0 commit comments

Comments
 (0)