UNPKG

agentsqripts

Version:

Comprehensive static code analysis toolkit for identifying technical debt, security vulnerabilities, performance issues, and code quality problems

22 lines (18 loc) 636 B
/** * @file Path validation utility for absolute path detection * @description Single responsibility: Check if a path is absolute or relative */ const path = require('path'); /** * Check if a path is absolute * @param {string} inputPath - The path to check * @returns {boolean} True if path is absolute, false if relative */ function isAbsolutePath(inputPath) { if (!inputPath || typeof inputPath !== 'string') { return false; } // Check for Windows absolute paths (C:, D:, etc.) and Unix absolute paths (/) return path.isAbsolute(inputPath) || /^[A-Za-z]:\\/.test(inputPath); } module.exports = isAbsolutePath;