const showNumber = (lineInfo) => { const first = lineInfo.line[0]; return first === ' ' || first === '@' || first === '-' || first === '+'; } const construct = (data) => { const diffs = data.diffs let result = `
Old | ${diffs.old}} | |
New | ${diffs.new} | |
${showNumber(lineInfo) ? lineInfo['num-old'] : ' '} | ${showNumber(lineInfo) ? lineInfo['num-new'] : ' '} |
${lineInfo.line} |