{"action":"created","issue":{"url":"https://api.github.com/repos/kpdecker/jsdiff/issues/209","repository_url":"https://api.github.com/repos/kpdecker/jsdiff","labels_url":"https://api.github.com/repos/kpdecker/jsdiff/issues/209/labels{/name}","comments_url":"https://api.github.com/repos/kpdecker/jsdiff/issues/209/comments","events_url":"https://api.github.com/repos/kpdecker/jsdiff/issues/209/events","html_url":"https://github.com/kpdecker/jsdiff/issues/209","id":284331172,"number":209,"title":"createPatch adds new line in one-line oldStr","user":{"login":"damirm","id":924594,"avatar_url":"https://avatars2.githubusercontent.com/u/924594?v=4","gravatar_id":"","url":"https://api.github.com/users/damirm","html_url":"https://github.com/damirm","followers_url":"https://api.github.com/users/damirm/followers","following_url":"https://api.github.com/users/damirm/following{/other_user}","gists_url":"https://api.github.com/users/damirm/gists{/gist_id}","starred_url":"https://api.github.com/users/damirm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damirm/subscriptions","organizations_url":"https://api.github.com/users/damirm/orgs","repos_url":"https://api.github.com/users/damirm/repos","events_url":"https://api.github.com/users/damirm/events{/privacy}","received_events_url":"https://api.github.com/users/damirm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-23T22:56:03Z","updated_at":"2018-02-03T11:03:57Z","closed_at":null,"author_association":"NONE","body":"Is it expected behaviour?\r\n```\r\n> diff.applyPatch('', diff.createPatch('test', '', 'a'))\r\n'a\\n'\r\n```\r\n\r\nGenerated patch looks like:\r\n```\r\n> console.log(diff.createPatch('test', '', 'a'))\r\nIndex: test\r\n===================================================================\r\n--- test\r\n+++ test\r\n@@ -1,0 +1,1 @@\r\n\\ No newline at end of file\r\n+a\r\n\r\n```\r\n(with new line at the end)\r\n\r\nWhy createPatch added new line at the end?\r\nI didn't found test case for one line patches, without `\\n` in oldStr and newStr.\r\n"},"comment":{"url":"https://api.github.com/repos/kpdecker/jsdiff/issues/comments/362798238","html_url":"https://github.com/kpdecker/jsdiff/issues/209#issuecomment-362798238","issue_url":"https://api.github.com/repos/kpdecker/jsdiff/issues/209","id":362798238,"user":{"login":"damirm","id":924594,"avatar_url":"https://avatars2.githubusercontent.com/u/924594?v=4","gravatar_id":"","url":"https://api.github.com/users/damirm","html_url":"https://github.com/damirm","followers_url":"https://api.github.com/users/damirm/followers","following_url":"https://api.github.com/users/damirm/following{/other_user}","gists_url":"https://api.github.com/users/damirm/gists{/gist_id}","starred_url":"https://api.github.com/users/damirm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damirm/subscriptions","organizations_url":"https://api.github.com/users/damirm/orgs","repos_url":"https://api.github.com/users/damirm/repos","events_url":"https://api.github.com/users/damirm/events{/privacy}","received_events_url":"https://api.github.com/users/damirm/received_events","type":"User","site_admin":false},"created_at":"2018-02-03T11:03:57Z","updated_at":"2018-02-03T11:03:57Z","author_association":"NONE","body":"For example patch generated via `diff` utility:\r\n\r\n```\r\n$ cat a\r\n\r\n$ cat b\r\na\r\n$ diff -u a b\r\n--- a\t2018-02-03 13:59:41.000000000 +0300\r\n+++ b\t2018-02-03 13:59:45.000000000 +0300\r\n@@ -1 +1 @@\r\n-\r\n+a\r\n```\r\n\r\nThere is no new line at the end. \r\n"}}
{"actor":{"display_login":"damirm"}}