interface

diff.PatchOptions

interface PatchOptions

  • context?: number

    The number of unchanged lines before and after each change, like diff -U. An integer from 0, or Infinity for the whole file.

  • maxEditLength?: number

    Return undefined when the diff adds and removes more than this many tokens in total. An integer from 0, or Infinity.

  • newFileName?: string

    The name in the +++ line. Defaults to oldFileName.

  • newHeader?: string

    Text after the name in the +++ line, such as a timestamp. It needs a file name and has to be one line.

  • oldFileName?: string

    The name in the --- line. Defaults to newFileName. Without either name, the patch has no --- and +++ lines.

  • oldHeader?: string

    Text after the name in the --- line, such as a timestamp. It needs a file name and has to be one line.