-
Notifications
You must be signed in to change notification settings - Fork 524
Closed
Description
[const jsdiff = require("diff");
let text = `# Markdown
This is some markdown.
Let's find the diffs
`;
let newText = `# Markdown
This is some markdown.
Let's find the diffs and prove it all works.
`;
let diff = jsdiff.structuredPatch("old", "new", text, newText);
let newDoc = jsdiff.applyPatch(text, diff);
console.log(newDoc);
and what I get back is:
/home/nicferrier/jswork/sqlparsing/node_modules/diff/lib/patch/apply.js:111
delimiter = _hunk.linedelimiters[j];
^
TypeError: Cannot read property '0' of undefined
at Object.applyPatch (/home/nicferrier/jswork/sqlparsing/node_modules/diff/lib/patch/apply.js:111:43)
I couldn't find a test that does this... but since structuredPatch is at the heart of all the patch routines that seems a bit odd.
Help?
Metadata
Metadata
Assignees
Labels
No labels