콘텐츠로 이동

applyDiff

이 콘텐츠는 아직 번역되지 않았습니다.

function applyDiff(
input,
diff,
mode): string;

Applies a headerless V4A diff to the provided file content.

  • mode “default”: patch an existing file using V4A sections (”@@” + +/-/space lines).
  • mode “create”: create-file syntax that requires every line to start with ”+”.

The function preserves trailing newlines from the original file and throws when the diff cannot be applied cleanly.

Parameter Type Default value

input

string

undefined

diff

string

undefined

mode

"default" | "create"

'default'

string