{"action":"created","comment":{"url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/pulls/comments/38124430","id":38124430,"diff_hunk":"@@ -61,12 +55,12 @@ var generateQueryString = function(query, method, credentials) {\n         defaultParams['IdType'] = 'ASIN';\n         defaultParams['IncludeReviewsSummary'] = 'True';\n         defaultParams['TruncateReviewsAt'] = '1000';\n-        defaultParams['VariationPage'] = 'All';\n-        defaultParams['MaximumPrice'] = '';\n+        defaultParams['VariationPage'] = 'All';        \n \n-        for (param in query) {\n-            var capitalized = capitalize(param);\n-            params[capitalized] = query[param] || defaultParams[capitalized];\n+        for (param in defaultParams) {","path":"lib/utils.js","position":64,"original_position":64,"commit_id":"ad825deb08ae6966c4c006dfdccec20212783bd1","original_commit_id":"ad825deb08ae6966c4c006dfdccec20212783bd1","user":{"login":"t3chnoboy","id":2552790,"avatar_url":"https://avatars.githubusercontent.com/u/2552790?v=3","gravatar_id":"","url":"https://api.github.com/users/t3chnoboy","html_url":"https://github.com/t3chnoboy","followers_url":"https://api.github.com/users/t3chnoboy/followers","following_url":"https://api.github.com/users/t3chnoboy/following{/other_user}","gists_url":"https://api.github.com/users/t3chnoboy/gists{/gist_id}","starred_url":"https://api.github.com/users/t3chnoboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t3chnoboy/subscriptions","organizations_url":"https://api.github.com/users/t3chnoboy/orgs","repos_url":"https://api.github.com/users/t3chnoboy/repos","events_url":"https://api.github.com/users/t3chnoboy/events{/privacy}","received_events_url":"https://api.github.com/users/t3chnoboy/received_events","type":"User","site_admin":false},"body":"I see this pattern in couple of places. Can you extract it into a function?","created_at":"2015-08-27T17:47:52Z","updated_at":"2015-08-27T17:47:52Z","html_url":"https://github.com/t3chnoboy/amazon-product-api/pull/21#discussion_r38124430","pull_request_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/t3chnoboy/amazon-product-api/pulls/comments/38124430"},"html":{"href":"https://github.com/t3chnoboy/amazon-product-api/pull/21#discussion_r38124430"},"pull_request":{"href":"https://api.github.com/repos/t3chnoboy/amazon-product-api/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/pulls/21","id":43537141,"html_url":"https://github.com/t3chnoboy/amazon-product-api/pull/21","diff_url":"https://github.com/t3chnoboy/amazon-product-api/pull/21.diff","patch_url":"https://github.com/t3chnoboy/amazon-product-api/pull/21.patch","issue_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/issues/21","number":21,"state":"open","locked":false,"title":"Set default values","user":{"login":"masterT","id":2584158,"avatar_url":"https://avatars.githubusercontent.com/u/2584158?v=3","gravatar_id":"","url":"https://api.github.com/users/masterT","html_url":"https://github.com/masterT","followers_url":"https://api.github.com/users/masterT/followers","following_url":"https://api.github.com/users/masterT/following{/other_user}","gists_url":"https://api.github.com/users/masterT/gists{/gist_id}","starred_url":"https://api.github.com/users/masterT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masterT/subscriptions","organizations_url":"https://api.github.com/users/masterT/orgs","repos_url":"https://api.github.com/users/masterT/repos","events_url":"https://api.github.com/users/masterT/events{/privacy}","received_events_url":"https://api.github.com/users/masterT/received_events","type":"User","site_admin":false},"body":"- set default values\r\n- extract the code that format the query params in a new function\r\n‘formatQueryParams’\r\n- add test for default values\r\n\r\nFix issue #20","created_at":"2015-08-27T16:20:19Z","updated_at":"2015-08-27T17:47:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f354492c651b42dc238ca9b3406c214264feffc2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/pulls/21/commits","review_comments_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/pulls/21/comments","review_comment_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/issues/21/comments","statuses_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/statuses/ad825deb08ae6966c4c006dfdccec20212783bd1","head":{"label":"t3chnoboy:fix-default-values","ref":"fix-default-values","sha":"ad825deb08ae6966c4c006dfdccec20212783bd1","user":{"login":"t3chnoboy","id":2552790,"avatar_url":"https://avatars.githubusercontent.com/u/2552790?v=3","gravatar_id":"","url":"https://api.github.com/users/t3chnoboy","html_url":"https://github.com/t3chnoboy","followers_url":"https://api.github.com/users/t3chnoboy/followers","following_url":"https://api.github.com/users/t3chnoboy/following{/other_user}","gists_url":"https://api.github.com/users/t3chnoboy/gists{/gist_id}","starred_url":"https://api.github.com/users/t3chnoboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t3chnoboy/subscriptions","organizations_url":"https://api.github.com/users/t3chnoboy/orgs","repos_url":"https://api.github.com/users/t3chnoboy/repos","events_url":"https://api.github.com/users/t3chnoboy/events{/privacy}","received_events_url":"https://api.github.com/users/t3chnoboy/received_events","type":"User","site_admin":false},"repo":{"id":15508359,"name":"amazon-product-api","full_name":"t3chnoboy/amazon-product-api","owner":{"login":"t3chnoboy","id":2552790,"avatar_url":"https://avatars.githubusercontent.com/u/2552790?v=3","gravatar_id":"","url":"https://api.github.com/users/t3chnoboy","html_url":"https://github.com/t3chnoboy","followers_url":"https://api.github.com/users/t3chnoboy/followers","following_url":"https://api.github.com/users/t3chnoboy/following{/other_user}","gists_url":"https://api.github.com/users/t3chnoboy/gists{/gist_id}","starred_url":"https://api.github.com/users/t3chnoboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t3chnoboy/subscriptions","organizations_url":"https://api.github.com/users/t3chnoboy/orgs","repos_url":"https://api.github.com/users/t3chnoboy/repos","events_url":"https://api.github.com/users/t3chnoboy/events{/privacy}","received_events_url":"https://api.github.com/users/t3chnoboy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/t3chnoboy/amazon-product-api","description":":credit_card: Amazon Product Advertising API client","fork":false,"url":"https://api.github.com/repos/t3chnoboy/amazon-product-api","forks_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/forks","keys_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/teams","hooks_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/hooks","issue_events_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/issues/events{/number}","events_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/events","assignees_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/assignees{/user}","branches_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/branches{/branch}","tags_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/tags","blobs_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/statuses/{sha}","languages_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/languages","stargazers_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/stargazers","contributors_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/contributors","subscribers_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/subscribers","subscription_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/subscription","commits_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/contents/{+path}","compare_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/merges","archive_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/downloads","issues_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/issues{/number}","pulls_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/pulls{/number}","milestones_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/milestones{/number}","notifications_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/labels{/name}","releases_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/releases{/id}","created_at":"2013-12-29T12:44:24Z","updated_at":"2015-08-25T05:36:55Z","pushed_at":"2015-08-27T16:25:51Z","git_url":"git://github.com/t3chnoboy/amazon-product-api.git","ssh_url":"git@github.com:t3chnoboy/amazon-product-api.git","clone_url":"https://github.com/t3chnoboy/amazon-product-api.git","svn_url":"https://github.com/t3chnoboy/amazon-product-api","homepage":"","size":371,"stargazers_count":43,"watchers_count":43,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":2,"forks":14,"open_issues":2,"watchers":43,"default_branch":"master"}},"base":{"label":"t3chnoboy:master","ref":"master","sha":"ab59a043cc14500f2566260a2560c85bda849b61","user":{"login":"t3chnoboy","id":2552790,"avatar_url":"https://avatars.githubusercontent.com/u/2552790?v=3","gravatar_id":"","url":"https://api.github.com/users/t3chnoboy","html_url":"https://github.com/t3chnoboy","followers_url":"https://api.github.com/users/t3chnoboy/followers","following_url":"https://api.github.com/users/t3chnoboy/following{/other_user}","gists_url":"https://api.github.com/users/t3chnoboy/gists{/gist_id}","starred_url":"https://api.github.com/users/t3chnoboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t3chnoboy/subscriptions","organizations_url":"https://api.github.com/users/t3chnoboy/orgs","repos_url":"https://api.github.com/users/t3chnoboy/repos","events_url":"https://api.github.com/users/t3chnoboy/events{/privacy}","received_events_url":"https://api.github.com/users/t3chnoboy/received_events","type":"User","site_admin":false},"repo":{"id":15508359,"name":"amazon-product-api","full_name":"t3chnoboy/amazon-product-api","owner":{"login":"t3chnoboy","id":2552790,"avatar_url":"https://avatars.githubusercontent.com/u/2552790?v=3","gravatar_id":"","url":"https://api.github.com/users/t3chnoboy","html_url":"https://github.com/t3chnoboy","followers_url":"https://api.github.com/users/t3chnoboy/followers","following_url":"https://api.github.com/users/t3chnoboy/following{/other_user}","gists_url":"https://api.github.com/users/t3chnoboy/gists{/gist_id}","starred_url":"https://api.github.com/users/t3chnoboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t3chnoboy/subscriptions","organizations_url":"https://api.github.com/users/t3chnoboy/orgs","repos_url":"https://api.github.com/users/t3chnoboy/repos","events_url":"https://api.github.com/users/t3chnoboy/events{/privacy}","received_events_url":"https://api.github.com/users/t3chnoboy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/t3chnoboy/amazon-product-api","description":":credit_card: Amazon Product Advertising API client","fork":false,"url":"https://api.github.com/repos/t3chnoboy/amazon-product-api","forks_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/forks","keys_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/teams","hooks_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/hooks","issue_events_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/issues/events{/number}","events_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/events","assignees_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/assignees{/user}","branches_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/branches{/branch}","tags_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/tags","blobs_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/statuses/{sha}","languages_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/languages","stargazers_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/stargazers","contributors_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/contributors","subscribers_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/subscribers","subscription_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/subscription","commits_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/contents/{+path}","compare_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/merges","archive_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/downloads","issues_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/issues{/number}","pulls_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/pulls{/number}","milestones_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/milestones{/number}","notifications_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/labels{/name}","releases_url":"https://api.github.com/repos/t3chnoboy/amazon-product-api/releases{/id}","created_at":"2013-12-29T12:44:24Z","updated_at":"2015-08-25T05:36:55Z","pushed_at":"2015-08-27T16:25:51Z","git_url":"git://github.com/t3chnoboy/amazon-product-api.git","ssh_url":"git@github.com:t3chnoboy/amazon-product-api.git","clone_url":"https://github.com/t3chnoboy/amazon-product-api.git","svn_url":"https://github.com/t3chnoboy/amazon-product-api","homepage":"","size":371,"stargazers_count":43,"watchers_count":43,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":2,"forks":14,"open_issues":2,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/t3chnoboy/amazon-product-api/pulls/21"},"html":{"href":"https://github.com/t3chnoboy/amazon-product-api/pull/21"},"issue":{"href":"https://api.github.com/repos/t3chnoboy/amazon-product-api/issues/21"},"comments":{"href":"https://api.github.com/repos/t3chnoboy/amazon-product-api/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/t3chnoboy/amazon-product-api/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/t3chnoboy/amazon-product-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/t3chnoboy/amazon-product-api/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/t3chnoboy/amazon-product-api/statuses/ad825deb08ae6966c4c006dfdccec20212783bd1"}}}}