agentsqripts
Version:
Comprehensive static code analysis toolkit for identifying technical debt, security vulnerabilities, performance issues, and code quality problems
13 lines (11 loc) • 433 B
JavaScript
/**
* @file Check if difference is only in numeric values
* @description Single responsibility: Detect if two lines differ only in numbers
*/
function isNumberDifference(line1, line2) {
if (!line1 || !line2) return false;
const normalized1 = line1.replace(/\b\d+(\.\d+)?\b/g, 'NUM');
const normalized2 = line2.replace(/\b\d+(\.\d+)?\b/g, 'NUM');
return normalized1 === normalized2;
}
module.exports = isNumberDifference;