agentsqripts
Version:
Comprehensive static code analysis toolkit for identifying technical debt, security vulnerabilities, performance issues, and code quality problems
21 lines (18 loc) • 526 B
JavaScript
/**
* @file Resolve path to absolute
* @description Single responsibility: Convert relative paths to absolute paths
*/
const path = require('path');
/**
* Resolve path to absolute
* @param {string} targetPath - Path to resolve
* @returns {string} Absolute path
*/
function resolvePath(targetPath) {
// Handle null/undefined by converting to current directory
if (!targetPath || typeof targetPath !== 'string') {
return path.resolve('.');
}
return path.resolve(targetPath);
}
module.exports = resolvePath;