code: function fillLineNumber (hunk) {
    if (!hunk) {
      return hunk
    }
  
    const maxLineNumber = hunk.newStart + hunk.newLines
    const span = maxLineNumber.toString().length + 4 // 多四个空格
  
    let index = hunk.newStart
    let line
    let lineNumberStr
  
    for (let i = 0, j = hunk.lines.length; i < j; i++) {
      line = hunk.lines[i]
  
      if (line.startsWith('-')) {
        lineNumberStr = leftPad('| ', span)
      } else {
        lineNumberStr = leftPad(`${index++} | `, span)
      }
  
      hunk.lines[i] = line.slice(0, 1) + lineNumberStr + line.slice(1)
    }
  
    return hunk
  }
docs: 给 hunk 填充行号
  
  @param {jsDiff.hunk} hunk diff.hunk
  @returns {jsDiff.hunk} hunk