UNPKG

structure-validation

Version:

A Node.js CLI tool for validating codebase folder and file structure using a clean declarative configuration. Part of the guardz ecosystem for comprehensive TypeScript development.

35 lines 1.14 kB
import { FileInfo as FileInfoType } from '../types/validation.types'; /** * FileInfo entity representing a file in the codebase */ export declare class FileInfo implements FileInfoType { readonly path: string; readonly relativePath: string; readonly folder: string; readonly filename: string; constructor(filePath: string, basePath: string); /** * Extract the folder name from the relative path */ private extractFolder; /** * Check if the file matches any of the given patterns */ matchesPatterns(patterns: readonly string[], folderName?: string): boolean; /** * Check if the file matches a specific pattern */ matchesPattern(pattern: string, folderName?: string): boolean; /** * Convert glob pattern to regex, supporting {variable} placeholder for folder name */ private globToRegex; /** * Get the best matching folder suggestion based on filename patterns */ getSuggestedFolder(rules: readonly { folder: string; patterns: readonly string[]; }[]): string | null; } //# sourceMappingURL=FileInfo.d.ts.map