{"action":"created","comment":{"url":"https://api.github.com/repos/commercetools/nodejs/pulls/comments/169176213","pull_request_review_id":97661116,"id":169176213,"diff_hunk":"@@ -0,0 +1,16 @@\n+export default function extractMatchingPairs(hashMap, key, before, now) {\n+  let oldObjPos\n+  let newObjPos\n+  let oldObj\n+  let newObj\n+\n+  if (hashMap[key]) {\n+    oldObjPos = hashMap[key][0]\n+    newObjPos = hashMap[key][1]\n+    if (before && before[oldObjPos]) oldObj = before[oldObjPos]\n+\n+    if (now && now[newObjPos]) newObj = now[newObjPos]\n+  }\n+\n+  return { oldObj, newObj }","path":"packages/sync-actions/src/utils/extract-matching-pairs.js","position":15,"original_position":15,"commit_id":"67407fab5190e31f086ed9832adf0f7361a39d11","original_commit_id":"3c3ee799c321a1d8703583e6e24d43c9f41b60ed","user":{"login":"adnasa","id":462507,"avatar_url":"https://avatars1.githubusercontent.com/u/462507?v=4","gravatar_id":"","url":"https://api.github.com/users/adnasa","html_url":"https://github.com/adnasa","followers_url":"https://api.github.com/users/adnasa/followers","following_url":"https://api.github.com/users/adnasa/following{/other_user}","gists_url":"https://api.github.com/users/adnasa/gists{/gist_id}","starred_url":"https://api.github.com/users/adnasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adnasa/subscriptions","organizations_url":"https://api.github.com/users/adnasa/orgs","repos_url":"https://api.github.com/users/adnasa/repos","events_url":"https://api.github.com/users/adnasa/events{/privacy}","received_events_url":"https://api.github.com/users/adnasa/received_events","type":"User","site_admin":false},"body":"There is of course a great opportunity to rename these to `previous` and `next`. I prefer that naming, tbh. Not sure tho if it is part of this PR, at least in the scope of a new utility.","created_at":"2018-02-19T21:38:30Z","updated_at":"2018-02-19T21:40:19Z","html_url":"https://github.com/commercetools/nodejs/pull/467#discussion_r169176213","pull_request_url":"https://api.github.com/repos/commercetools/nodejs/pulls/467","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/commercetools/nodejs/pulls/comments/169176213"},"html":{"href":"https://github.com/commercetools/nodejs/pull/467#discussion_r169176213"},"pull_request":{"href":"https://api.github.com/repos/commercetools/nodejs/pulls/467"}}},"pull_request":{"url":"https://api.github.com/repos/commercetools/nodejs/pulls/467","id":170054899,"html_url":"https://github.com/commercetools/nodejs/pull/467","diff_url":"https://github.com/commercetools/nodejs/pull/467.diff","patch_url":"https://github.com/commercetools/nodejs/pull/467.patch","issue_url":"https://api.github.com/repos/commercetools/nodejs/issues/467","number":467,"state":"open","locked":false,"title":"feat(sync-actions): add `extract-matching-pairs`","user":{"login":"adnasa","id":462507,"avatar_url":"https://avatars1.githubusercontent.com/u/462507?v=4","gravatar_id":"","url":"https://api.github.com/users/adnasa","html_url":"https://github.com/adnasa","followers_url":"https://api.github.com/users/adnasa/followers","following_url":"https://api.github.com/users/adnasa/following{/other_user}","gists_url":"https://api.github.com/users/adnasa/gists{/gist_id}","starred_url":"https://api.github.com/users/adnasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adnasa/subscriptions","organizations_url":"https://api.github.com/users/adnasa/orgs","repos_url":"https://api.github.com/users/adnasa/repos","events_url":"https://api.github.com/users/adnasa/events{/privacy}","received_events_url":"https://api.github.com/users/adnasa/received_events","type":"User","site_admin":false},"body":"#### Summary\r\n\r\nExtracting this utility out of [`product-actions`](https://github.com/commercetools/nodejs/blob/master/packages/sync-actions/src/product-actions.js#L157-L172)\r\n\r\nThis is needed as well for attributes and enums on the [product-types-actions](https://github.com/commercetools/nodejs/blob/aa-add-product-types-sync-actions/packages/sync-actions/src/product-types-actions.js#L53-L58).\r\n\r\nImport on the product-actions will follow.","created_at":"2018-02-19T21:22:52Z","updated_at":"2018-02-19T21:40:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"41cfc0acaa05f8e46e84db07e926982341493b79","assignee":{"login":"adnasa","id":462507,"avatar_url":"https://avatars1.githubusercontent.com/u/462507?v=4","gravatar_id":"","url":"https://api.github.com/users/adnasa","html_url":"https://github.com/adnasa","followers_url":"https://api.github.com/users/adnasa/followers","following_url":"https://api.github.com/users/adnasa/following{/other_user}","gists_url":"https://api.github.com/users/adnasa/gists{/gist_id}","starred_url":"https://api.github.com/users/adnasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adnasa/subscriptions","organizations_url":"https://api.github.com/users/adnasa/orgs","repos_url":"https://api.github.com/users/adnasa/repos","events_url":"https://api.github.com/users/adnasa/events{/privacy}","received_events_url":"https://api.github.com/users/adnasa/received_events","type":"User","site_admin":false},"assignees":[{"login":"adnasa","id":462507,"avatar_url":"https://avatars1.githubusercontent.com/u/462507?v=4","gravatar_id":"","url":"https://api.github.com/users/adnasa","html_url":"https://github.com/adnasa","followers_url":"https://api.github.com/users/adnasa/followers","following_url":"https://api.github.com/users/adnasa/following{/other_user}","gists_url":"https://api.github.com/users/adnasa/gists{/gist_id}","starred_url":"https://api.github.com/users/adnasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adnasa/subscriptions","organizations_url":"https://api.github.com/users/adnasa/orgs","repos_url":"https://api.github.com/users/adnasa/repos","events_url":"https://api.github.com/users/adnasa/events{/privacy}","received_events_url":"https://api.github.com/users/adnasa/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":458563458,"url":"https://api.github.com/repos/commercetools/nodejs/labels/Type:%20Enhancement","name":"Type: Enhancement","color":"84b6eb","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/commercetools/nodejs/pulls/467/commits","review_comments_url":"https://api.github.com/repos/commercetools/nodejs/pulls/467/comments","review_comment_url":"https://api.github.com/repos/commercetools/nodejs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/commercetools/nodejs/issues/467/comments","statuses_url":"https://api.github.com/repos/commercetools/nodejs/statuses/67407fab5190e31f086ed9832adf0f7361a39d11","head":{"label":"commercetools:aa-extract-extract-matching-pairs","ref":"aa-extract-extract-matching-pairs","sha":"67407fab5190e31f086ed9832adf0f7361a39d11","user":{"login":"commercetools","id":1084585,"avatar_url":"https://avatars3.githubusercontent.com/u/1084585?v=4","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"repo":{"id":70048127,"name":"nodejs","full_name":"commercetools/nodejs","owner":{"login":"commercetools","id":1084585,"avatar_url":"https://avatars3.githubusercontent.com/u/1084585?v=4","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/commercetools/nodejs","description":"Everything related to the Node.js ecosystem for the commercetools platform.","fork":false,"url":"https://api.github.com/repos/commercetools/nodejs","forks_url":"https://api.github.com/repos/commercetools/nodejs/forks","keys_url":"https://api.github.com/repos/commercetools/nodejs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/commercetools/nodejs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/commercetools/nodejs/teams","hooks_url":"https://api.github.com/repos/commercetools/nodejs/hooks","issue_events_url":"https://api.github.com/repos/commercetools/nodejs/issues/events{/number}","events_url":"https://api.github.com/repos/commercetools/nodejs/events","assignees_url":"https://api.github.com/repos/commercetools/nodejs/assignees{/user}","branches_url":"https://api.github.com/repos/commercetools/nodejs/branches{/branch}","tags_url":"https://api.github.com/repos/commercetools/nodejs/tags","blobs_url":"https://api.github.com/repos/commercetools/nodejs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/commercetools/nodejs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/commercetools/nodejs/git/refs{/sha}","trees_url":"https://api.github.com/repos/commercetools/nodejs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/commercetools/nodejs/statuses/{sha}","languages_url":"https://api.github.com/repos/commercetools/nodejs/languages","stargazers_url":"https://api.github.com/repos/commercetools/nodejs/stargazers","contributors_url":"https://api.github.com/repos/commercetools/nodejs/contributors","subscribers_url":"https://api.github.com/repos/commercetools/nodejs/subscribers","subscription_url":"https://api.github.com/repos/commercetools/nodejs/subscription","commits_url":"https://api.github.com/repos/commercetools/nodejs/commits{/sha}","git_commits_url":"https://api.github.com/repos/commercetools/nodejs/git/commits{/sha}","comments_url":"https://api.github.com/repos/commercetools/nodejs/comments{/number}","issue_comment_url":"https://api.github.com/repos/commercetools/nodejs/issues/comments{/number}","contents_url":"https://api.github.com/repos/commercetools/nodejs/contents/{+path}","compare_url":"https://api.github.com/repos/commercetools/nodejs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/commercetools/nodejs/merges","archive_url":"https://api.github.com/repos/commercetools/nodejs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/commercetools/nodejs/downloads","issues_url":"https://api.github.com/repos/commercetools/nodejs/issues{/number}","pulls_url":"https://api.github.com/repos/commercetools/nodejs/pulls{/number}","milestones_url":"https://api.github.com/repos/commercetools/nodejs/milestones{/number}","notifications_url":"https://api.github.com/repos/commercetools/nodejs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/commercetools/nodejs/labels{/name}","releases_url":"https://api.github.com/repos/commercetools/nodejs/releases{/id}","deployments_url":"https://api.github.com/repos/commercetools/nodejs/deployments","created_at":"2016-10-05T09:53:20Z","updated_at":"2018-01-08T15:45:41Z","pushed_at":"2018-02-19T21:37:31Z","git_url":"git://github.com/commercetools/nodejs.git","ssh_url":"git@github.com:commercetools/nodejs.git","clone_url":"https://github.com/commercetools/nodejs.git","svn_url":"https://github.com/commercetools/nodejs","homepage":"https://commercetools.github.io/nodejs/","size":2700,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":26,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":6,"open_issues":26,"watchers":9,"default_branch":"master"}},"base":{"label":"commercetools:master","ref":"master","sha":"e8b3c282f8f9a999606e2f989775a9ba886e77d8","user":{"login":"commercetools","id":1084585,"avatar_url":"https://avatars3.githubusercontent.com/u/1084585?v=4","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"repo":{"id":70048127,"name":"nodejs","full_name":"commercetools/nodejs","owner":{"login":"commercetools","id":1084585,"avatar_url":"https://avatars3.githubusercontent.com/u/1084585?v=4","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/commercetools/nodejs","description":"Everything related to the Node.js ecosystem for the commercetools platform.","fork":false,"url":"https://api.github.com/repos/commercetools/nodejs","forks_url":"https://api.github.com/repos/commercetools/nodejs/forks","keys_url":"https://api.github.com/repos/commercetools/nodejs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/commercetools/nodejs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/commercetools/nodejs/teams","hooks_url":"https://api.github.com/repos/commercetools/nodejs/hooks","issue_events_url":"https://api.github.com/repos/commercetools/nodejs/issues/events{/number}","events_url":"https://api.github.com/repos/commercetools/nodejs/events","assignees_url":"https://api.github.com/repos/commercetools/nodejs/assignees{/user}","branches_url":"https://api.github.com/repos/commercetools/nodejs/branches{/branch}","tags_url":"https://api.github.com/repos/commercetools/nodejs/tags","blobs_url":"https://api.github.com/repos/commercetools/nodejs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/commercetools/nodejs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/commercetools/nodejs/git/refs{/sha}","trees_url":"https://api.github.com/repos/commercetools/nodejs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/commercetools/nodejs/statuses/{sha}","languages_url":"https://api.github.com/repos/commercetools/nodejs/languages","stargazers_url":"https://api.github.com/repos/commercetools/nodejs/stargazers","contributors_url":"https://api.github.com/repos/commercetools/nodejs/contributors","subscribers_url":"https://api.github.com/repos/commercetools/nodejs/subscribers","subscription_url":"https://api.github.com/repos/commercetools/nodejs/subscription","commits_url":"https://api.github.com/repos/commercetools/nodejs/commits{/sha}","git_commits_url":"https://api.github.com/repos/commercetools/nodejs/git/commits{/sha}","comments_url":"https://api.github.com/repos/commercetools/nodejs/comments{/number}","issue_comment_url":"https://api.github.com/repos/commercetools/nodejs/issues/comments{/number}","contents_url":"https://api.github.com/repos/commercetools/nodejs/contents/{+path}","compare_url":"https://api.github.com/repos/commercetools/nodejs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/commercetools/nodejs/merges","archive_url":"https://api.github.com/repos/commercetools/nodejs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/commercetools/nodejs/downloads","issues_url":"https://api.github.com/repos/commercetools/nodejs/issues{/number}","pulls_url":"https://api.github.com/repos/commercetools/nodejs/pulls{/number}","milestones_url":"https://api.github.com/repos/commercetools/nodejs/milestones{/number}","notifications_url":"https://api.github.com/repos/commercetools/nodejs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/commercetools/nodejs/labels{/name}","releases_url":"https://api.github.com/repos/commercetools/nodejs/releases{/id}","deployments_url":"https://api.github.com/repos/commercetools/nodejs/deployments","created_at":"2016-10-05T09:53:20Z","updated_at":"2018-01-08T15:45:41Z","pushed_at":"2018-02-19T21:37:31Z","git_url":"git://github.com/commercetools/nodejs.git","ssh_url":"git@github.com:commercetools/nodejs.git","clone_url":"https://github.com/commercetools/nodejs.git","svn_url":"https://github.com/commercetools/nodejs","homepage":"https://commercetools.github.io/nodejs/","size":2700,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":26,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":6,"open_issues":26,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/commercetools/nodejs/pulls/467"},"html":{"href":"https://github.com/commercetools/nodejs/pull/467"},"issue":{"href":"https://api.github.com/repos/commercetools/nodejs/issues/467"},"comments":{"href":"https://api.github.com/repos/commercetools/nodejs/issues/467/comments"},"review_comments":{"href":"https://api.github.com/repos/commercetools/nodejs/pulls/467/comments"},"review_comment":{"href":"https://api.github.com/repos/commercetools/nodejs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/commercetools/nodejs/pulls/467/commits"},"statuses":{"href":"https://api.github.com/repos/commercetools/nodejs/statuses/67407fab5190e31f086ed9832adf0f7361a39d11"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"adnasa"}}