UNPKG

sicua

Version:

A tool for analyzing project structure and dependencies

40 lines (39 loc) 1.43 kB
import { ComponentRelation } from "../../types"; export declare class ValidationUtils { /** * Validates a component relation object */ static validateComponentRelation(component: ComponentRelation): void; /** * Validates an array of component relations */ static validateComponentRelations(components: ComponentRelation[]): void; /** * Validates a file path exists and has correct extension */ static validateSourceFile(filePath: string): boolean; /** * Validates an object has required properties */ static validateRequiredProperties<T extends object>(obj: T, requiredProps: (keyof T)[]): void; /** * Validates a string is not empty or whitespace */ static validateNonEmptyString(value: string, fieldName: string): void; /** * Validates an array is not empty */ static validateNonEmptyArray<T>(array: T[] | undefined | null, arrayName: string): void; /** * Ensures a value is within a valid range */ static validateRange(value: number, min: number, max: number, fieldName: string): void; /** * Type guard to check if value is not null or undefined */ static isDefined<T>(value: T | null | undefined): value is T; /** * Validates an object's type structure */ static validateObjectStructure<T extends object>(obj: unknown, validator: (obj: unknown) => obj is T): T; }