UNPKG

1.27 kBTypeScriptView Raw
1import { StrykerOptions } from '@stryker-mutator/api/core';
2import { Immutable } from '@stryker-mutator/util';
3import { Logger } from '@stryker-mutator/api/logging';
4import type { JSONSchema7 } from 'json-schema';
5export declare class OptionsValidator {
6 private readonly schema;
7 private readonly log;
8 private readonly validateFn;
9 static readonly inject: ["validationSchema", "logger"];
10 constructor(schema: JSONSchema7, log: Logger);
11 /**
12 * Validates the provided options, throwing an error if something is wrong.
13 * Optionally also warns about excess or unserializable options.
14 * @param options The stryker options to validate
15 * @param mark Wether or not to log warnings on unknown properties or unserializable properties
16 */
17 validate(options: Record<string, unknown>, mark?: boolean): asserts options is StrykerOptions;
18 private removeDeprecatedOptions;
19 private customValidation;
20 private schemaValidate;
21 private throwErrorIfNeeded;
22 private markOptions;
23 private markExcessOptions;
24 private markUnserializableOptions;
25}
26export declare function createDefaultOptions(): StrykerOptions;
27export declare const defaultOptions: Immutable<StrykerOptions>;
28//# sourceMappingURL=options-validator.d.ts.map
\No newline at end of file