@bobmatnyc/ai-code-review
Version:
A TypeScript-based tool for automated code reviews using AI models from Google Gemini, Anthropic Claude, and OpenRouter
41 lines (40 loc) • 1.31 kB
TypeScript
/**
* @fileoverview Path validation utilities.
*
* This module provides utilities for validating file and directory paths,
* ensuring they are safe to use and exist on the file system.
*/
/**
* Check if a path is within the current directory or its subdirectories
* @param targetPath Path to check
* @returns True if the path is within the current directory, false otherwise
*/
export declare function isPathWithinCwd(targetPath: string): boolean;
/**
* Check if a path exists
* @param targetPath Path to check
* @returns True if the path exists, false otherwise
*/
export declare function pathExists(targetPath: string): boolean;
/**
* Check if a path is a directory
* @param targetPath Path to check
* @returns True if the path is a directory, false otherwise
*/
export declare function isDirectory(targetPath: string): boolean;
/**
* Check if a path is a file
* @param targetPath Path to check
* @returns True if the path is a file, false otherwise
*/
export declare function isFile(targetPath: string): boolean;
/**
* Validate a target path for security and existence
* @param targetPath Path to validate
* @returns Object with validation results
*/
export declare function validateTargetPath(targetPath: string): {
isValid: boolean;
isDir: boolean;
error?: string;
};