function validate
validate(userRunOptions: UserRunOptions): void

Rejects options the run cannot honour, before anything is launched.

Only the closed sets and the bounded numbers are checked here — the same ones Args.parse validates for argv. Everything else is either free-form (a filter, a path) or already a compile-time error for a TypeScript caller; this is the guard for the ones that are neither, which is exactly what a JavaScript caller or a generated call can get wrong.

import { validate, InvalidOption } from './options.ts';

try {
  validate({ browser: 'netscape' as 'chromium' });
} catch (error) {
  InvalidOption.is(error); // true
}

Parameters

userRunOptions: UserRunOptions

Return Type

void

Usage

import { validate } from "lib/api/options.ts";