guardz
Version:
A simple and lightweight TypeScript type guard library for runtime type validation.
11 lines (10 loc) • 585 B
TypeScript
import { TypeGuardFn } from '../typeguards/isType';
import { ValidationResult, ValidationContext } from './validationTypes';
/**
* Validate an object with multiple properties using functional approach
* @param value - The value to validate
* @param propsTypesToCheck - Object containing type guards for each property
* @param context - The validation context
* @returns A ValidationResult for the entire object
*/
export declare const validateObject: <T>(value: unknown, propsTypesToCheck: { [P in keyof T]: TypeGuardFn<T[P]>; }, context: ValidationContext) => ValidationResult;