UNPKG

docudb

Version:

Document-based NoSQL database for NodeJS

19 lines 686 B
interface ValidatedPath { safePath: string | null; error: string | null; } /** * Validates paths to prevent path traversal attacks * @param {string} userPath - User-provided path * @param {string} baseDir - Allowed base directory * @returns {Object} - {isValid: boolean, safePath: string, error: string} */ declare function validatePath(userPath: string, baseDir: string): ValidatedPath; /** * Validate and sanitize a directory name * @param {string} name - Directory name * @returns {string} - Sanitized directory name */ declare function sanitizeName(userPath: string): ValidatedPath; export { validatePath, sanitizeName }; //# sourceMappingURL=pathValidator.d.ts.map