UNPKG

kist

Version:

Package Pipeline Processor

44 lines (43 loc) 1.56 kB
import { OptionsInterface } from "../../interface/OptionsInterface"; import { AbstractValidator } from "../abstract/AbstractValidator"; /** * OptionsValidator provides centralized validation logic for pipeline options. * Extends AbstractValidator for consistent validation and logging. */ export declare class OptionsValidator extends AbstractValidator<OptionsInterface> { /** * A runtime mapping of enumerated options for validation. */ private static allowedValues; constructor(); /** * Validates a specific property of the options object. * * @param key - The key of the option to validate. * @param value - The value of the option to validate. * @throws Error if validation fails. */ protected validateProperty<K extends keyof OptionsInterface>(key: K, value: OptionsInterface[K]): void; /** * Validates a property based on its type when it does not have predefined * allowed values. * * @param key - The key to validate. * @param value - The value to validate. */ private validateByType; /** * Validates the `live` configuration, ensuring all nested properties * conform to their expected types and ranges. * * @param value - The live reload configuration to validate. */ private validateLiveOptions; /** * Checks if the given value is a valid object. * * @param value - The value to check. * @returns True if the value is an object and not null or an array. */ private isValidObject; }