Ensures a validator is defined in the configuration. Type assertion function that throws if validator is undefined.
Validator configuration to validate
If no validator is defined in configuration
const config = readConfigFile();ensureValidatorExists(config.validator);// Now TypeScript knows validator is defined Copy
const config = readConfigFile();ensureValidatorExists(config.validator);// Now TypeScript knows validator is defined
Ensures a validator is defined in the configuration. Type assertion function that throws if validator is undefined.