How to use the push function from diff

Find comprehensive JavaScript diff.push code examples handpicked from public code repositorys.

11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
ret.push('===================================================================');
ret.push('--- ' + oldFileName + (typeof oldHeader === 'undefined' ? '' : '\t' + oldHeader));
ret.push('+++ ' + newFileName + (typeof newHeader === 'undefined' ? '' : '\t' + newHeader));

var diff = PatchDiff.diff(oldStr, newStr);
diff.push({value: '', lines: []});   // Append an empty value to make cleanup easier

// Formats a given set of lines for printing as context lines in a patch
function contextLines(lines) {
  return map(lines, function(entry) { return ' ' + entry; });
fork icon0
star icon2
watch icon2