{"action":"created","comment":{"url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/comments/88525519","pull_request_review_id":9097402,"id":88525519,"diff_hunk":"@@ -685,6 +709,115 @@\n       },\n       transferable: function(predicate, item) {\n         return !item.notransfer;\n+      },\n+      rof: function(predicate, item) {\n+        return filterByStats.do(predicate, item, 'rof');\n+      },\n+      impact: function(predicate, item) {\n+        return filterByStats.do(predicate, item, 'impact');\n+      },\n+      range: function(predicate, item) {\n+        return filterByStats.do(predicate, item, 'range');\n+      },\n+      stability: function(predicate, item) {\n+        return filterByStats.do(predicate, item, 'stability');\n+      },\n+      reload: function(predicate, item) {\n+        return filterByStats.do(predicate, item, 'reload');\n+      },\n+      magazine: function(predicate, item) {\n+        return filterByStats.do(predicate, item, 'magazine');\n+      },\n+      aimassist: function(predicate, item) {\n+        return filterByStats.do(predicate, item, 'aa');\n+      },\n+      equipspeed: function(predicate, item) {\n+        return filterByStats.do(predicate, item, 'equipspeed');\n+      }\n+    };\n+\n+    // This refactored method filters items by stats\n+    //   * statType = [aa|impact|range|stability|rof|reload|magazine|equipspeed]\n+    var filterByStats = {\n+      do: function(predicate, item, statType) {\n+        if (predicate.length === 0 || item.stats === undefined) {\n+          return false;\n+        }\n+\n+        var operands = ['<=', '>=', '=', '>', '<'];\n+        var operand = 'none';\n+        var result = false;\n+        var statHash = 0;\n+\n+        operands.forEach(function(element) {\n+          if (predicate.substring(0, element.length) === element) {\n+            operand = element;\n+            predicate = predicate.substring(element.length);\n+            return false;\n+          } else {\n+            return true;\n+          }\n+        }, this);\n+\n+        switch (statType) {\n+          case 'impact': // Impact\n+            statHash = 4043523819;\n+            break;\n+          case 'range': // Range\n+            statHash = 1240592695;\n+            break;\n+          case 'stability': // Stability\n+            statHash = 155624089;\n+            break;\n+          case 'rof': // Rate of fire\n+            statHash = 4284893193;\n+            break;\n+          case 'reload': // Reload\n+            statHash = 4188031367;\n+            break;","path":"app/scripts/shell/dimSearchFilter.directive.js","position":100,"original_position":100,"commit_id":"5a418b1f00db2b84820baeb1eb151cbbb61a0936","original_commit_id":"5a418b1f00db2b84820baeb1eb151cbbb61a0936","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Expected indentation of 10 space characters but found 12  indent","created_at":"2016-11-17T19:18:49Z","updated_at":"2016-11-17T19:18:49Z","html_url":"https://github.com/DestinyItemManager/DIM/pull/1191#discussion_r88525519","pull_request_url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/1191","_links":{"self":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/comments/88525519"},"html":{"href":"https://github.com/DestinyItemManager/DIM/pull/1191#discussion_r88525519"},"pull_request":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/1191"}}},"pull_request":{"url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/1191","id":94231248,"html_url":"https://github.com/DestinyItemManager/DIM/pull/1191","diff_url":"https://github.com/DestinyItemManager/DIM/pull/1191.diff","patch_url":"https://github.com/DestinyItemManager/DIM/pull/1191.patch","issue_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/1191","number":1191,"state":"open","locked":false,"title":"Filter weapons by stats","user":{"login":"brunnopleffken","id":3427344,"avatar_url":"https://avatars.githubusercontent.com/u/3427344?v=3","gravatar_id":"","url":"https://api.github.com/users/brunnopleffken","html_url":"https://github.com/brunnopleffken","followers_url":"https://api.github.com/users/brunnopleffken/followers","following_url":"https://api.github.com/users/brunnopleffken/following{/other_user}","gists_url":"https://api.github.com/users/brunnopleffken/gists{/gist_id}","starred_url":"https://api.github.com/users/brunnopleffken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunnopleffken/subscriptions","organizations_url":"https://api.github.com/users/brunnopleffken/orgs","repos_url":"https://api.github.com/users/brunnopleffken/repos","events_url":"https://api.github.com/users/brunnopleffken/events{/privacy}","received_events_url":"https://api.github.com/users/brunnopleffken/received_events","type":"User","site_admin":false},"body":"Added new filters for weapons' stats (as proposed in #1173). They work the same way as `light:`, but it iterates in `item.stats` to get the values. Well... the new filters are:\r\n\r\n- rof:value\r\n- impact:value\r\n- range:value\r\n- stability:value\r\n- reload:value\r\n- magazine:value\r\n- aimassist:value _or_ aa:value\r\n- equipspeed:value\r\n\r\nAnd I think the help page is clear enough.","created_at":"2016-11-17T19:15:21Z","updated_at":"2016-11-17T19:18:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17e6744dc3befa074cefb5c4e7fcaa3a4448504e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/1191/commits","review_comments_url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/1191/comments","review_comment_url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/1191/comments","statuses_url":"https://api.github.com/repos/DestinyItemManager/DIM/statuses/5a418b1f00db2b84820baeb1eb151cbbb61a0936","head":{"label":"brunnopleffken:filter-by-stats","ref":"filter-by-stats","sha":"5a418b1f00db2b84820baeb1eb151cbbb61a0936","user":{"login":"brunnopleffken","id":3427344,"avatar_url":"https://avatars.githubusercontent.com/u/3427344?v=3","gravatar_id":"","url":"https://api.github.com/users/brunnopleffken","html_url":"https://github.com/brunnopleffken","followers_url":"https://api.github.com/users/brunnopleffken/followers","following_url":"https://api.github.com/users/brunnopleffken/following{/other_user}","gists_url":"https://api.github.com/users/brunnopleffken/gists{/gist_id}","starred_url":"https://api.github.com/users/brunnopleffken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunnopleffken/subscriptions","organizations_url":"https://api.github.com/users/brunnopleffken/orgs","repos_url":"https://api.github.com/users/brunnopleffken/repos","events_url":"https://api.github.com/users/brunnopleffken/events{/privacy}","received_events_url":"https://api.github.com/users/brunnopleffken/received_events","type":"User","site_admin":false},"repo":{"id":74042109,"name":"DIM","full_name":"brunnopleffken/DIM","owner":{"login":"brunnopleffken","id":3427344,"avatar_url":"https://avatars.githubusercontent.com/u/3427344?v=3","gravatar_id":"","url":"https://api.github.com/users/brunnopleffken","html_url":"https://github.com/brunnopleffken","followers_url":"https://api.github.com/users/brunnopleffken/followers","following_url":"https://api.github.com/users/brunnopleffken/following{/other_user}","gists_url":"https://api.github.com/users/brunnopleffken/gists{/gist_id}","starred_url":"https://api.github.com/users/brunnopleffken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunnopleffken/subscriptions","organizations_url":"https://api.github.com/users/brunnopleffken/orgs","repos_url":"https://api.github.com/users/brunnopleffken/repos","events_url":"https://api.github.com/users/brunnopleffken/events{/privacy}","received_events_url":"https://api.github.com/users/brunnopleffken/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brunnopleffken/DIM","description":"Destiny Item Manager","fork":true,"url":"https://api.github.com/repos/brunnopleffken/DIM","forks_url":"https://api.github.com/repos/brunnopleffken/DIM/forks","keys_url":"https://api.github.com/repos/brunnopleffken/DIM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brunnopleffken/DIM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brunnopleffken/DIM/teams","hooks_url":"https://api.github.com/repos/brunnopleffken/DIM/hooks","issue_events_url":"https://api.github.com/repos/brunnopleffken/DIM/issues/events{/number}","events_url":"https://api.github.com/repos/brunnopleffken/DIM/events","assignees_url":"https://api.github.com/repos/brunnopleffken/DIM/assignees{/user}","branches_url":"https://api.github.com/repos/brunnopleffken/DIM/branches{/branch}","tags_url":"https://api.github.com/repos/brunnopleffken/DIM/tags","blobs_url":"https://api.github.com/repos/brunnopleffken/DIM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brunnopleffken/DIM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brunnopleffken/DIM/git/refs{/sha}","trees_url":"https://api.github.com/repos/brunnopleffken/DIM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brunnopleffken/DIM/statuses/{sha}","languages_url":"https://api.github.com/repos/brunnopleffken/DIM/languages","stargazers_url":"https://api.github.com/repos/brunnopleffken/DIM/stargazers","contributors_url":"https://api.github.com/repos/brunnopleffken/DIM/contributors","subscribers_url":"https://api.github.com/repos/brunnopleffken/DIM/subscribers","subscription_url":"https://api.github.com/repos/brunnopleffken/DIM/subscription","commits_url":"https://api.github.com/repos/brunnopleffken/DIM/commits{/sha}","git_commits_url":"https://api.github.com/repos/brunnopleffken/DIM/git/commits{/sha}","comments_url":"https://api.github.com/repos/brunnopleffken/DIM/comments{/number}","issue_comment_url":"https://api.github.com/repos/brunnopleffken/DIM/issues/comments{/number}","contents_url":"https://api.github.com/repos/brunnopleffken/DIM/contents/{+path}","compare_url":"https://api.github.com/repos/brunnopleffken/DIM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brunnopleffken/DIM/merges","archive_url":"https://api.github.com/repos/brunnopleffken/DIM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brunnopleffken/DIM/downloads","issues_url":"https://api.github.com/repos/brunnopleffken/DIM/issues{/number}","pulls_url":"https://api.github.com/repos/brunnopleffken/DIM/pulls{/number}","milestones_url":"https://api.github.com/repos/brunnopleffken/DIM/milestones{/number}","notifications_url":"https://api.github.com/repos/brunnopleffken/DIM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brunnopleffken/DIM/labels{/name}","releases_url":"https://api.github.com/repos/brunnopleffken/DIM/releases{/id}","deployments_url":"https://api.github.com/repos/brunnopleffken/DIM/deployments","created_at":"2016-11-17T15:49:14Z","updated_at":"2016-11-17T15:49:16Z","pushed_at":"2016-11-17T19:18:36Z","git_url":"git://github.com/brunnopleffken/DIM.git","ssh_url":"git@github.com:brunnopleffken/DIM.git","clone_url":"https://github.com/brunnopleffken/DIM.git","svn_url":"https://github.com/brunnopleffken/DIM","homepage":"https://chrome.google.com/webstore/detail/destiny-item-manager/apghicjnekejhfancbkahkhdckhdagna","size":254440,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"DestinyItemManager:dev","ref":"dev","sha":"a174eb14941cbf454729dfa6736d1c5ab107a64f","user":{"login":"DestinyItemManager","id":12777189,"avatar_url":"https://avatars.githubusercontent.com/u/12777189?v=3","gravatar_id":"","url":"https://api.github.com/users/DestinyItemManager","html_url":"https://github.com/DestinyItemManager","followers_url":"https://api.github.com/users/DestinyItemManager/followers","following_url":"https://api.github.com/users/DestinyItemManager/following{/other_user}","gists_url":"https://api.github.com/users/DestinyItemManager/gists{/gist_id}","starred_url":"https://api.github.com/users/DestinyItemManager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DestinyItemManager/subscriptions","organizations_url":"https://api.github.com/users/DestinyItemManager/orgs","repos_url":"https://api.github.com/users/DestinyItemManager/repos","events_url":"https://api.github.com/users/DestinyItemManager/events{/privacy}","received_events_url":"https://api.github.com/users/DestinyItemManager/received_events","type":"Organization","site_admin":false},"repo":{"id":31681575,"name":"DIM","full_name":"DestinyItemManager/DIM","owner":{"login":"DestinyItemManager","id":12777189,"avatar_url":"https://avatars.githubusercontent.com/u/12777189?v=3","gravatar_id":"","url":"https://api.github.com/users/DestinyItemManager","html_url":"https://github.com/DestinyItemManager","followers_url":"https://api.github.com/users/DestinyItemManager/followers","following_url":"https://api.github.com/users/DestinyItemManager/following{/other_user}","gists_url":"https://api.github.com/users/DestinyItemManager/gists{/gist_id}","starred_url":"https://api.github.com/users/DestinyItemManager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DestinyItemManager/subscriptions","organizations_url":"https://api.github.com/users/DestinyItemManager/orgs","repos_url":"https://api.github.com/users/DestinyItemManager/repos","events_url":"https://api.github.com/users/DestinyItemManager/events{/privacy}","received_events_url":"https://api.github.com/users/DestinyItemManager/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DestinyItemManager/DIM","description":"Destiny Item Manager","fork":false,"url":"https://api.github.com/repos/DestinyItemManager/DIM","forks_url":"https://api.github.com/repos/DestinyItemManager/DIM/forks","keys_url":"https://api.github.com/repos/DestinyItemManager/DIM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DestinyItemManager/DIM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DestinyItemManager/DIM/teams","hooks_url":"https://api.github.com/repos/DestinyItemManager/DIM/hooks","issue_events_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/events{/number}","events_url":"https://api.github.com/repos/DestinyItemManager/DIM/events","assignees_url":"https://api.github.com/repos/DestinyItemManager/DIM/assignees{/user}","branches_url":"https://api.github.com/repos/DestinyItemManager/DIM/branches{/branch}","tags_url":"https://api.github.com/repos/DestinyItemManager/DIM/tags","blobs_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/refs{/sha}","trees_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DestinyItemManager/DIM/statuses/{sha}","languages_url":"https://api.github.com/repos/DestinyItemManager/DIM/languages","stargazers_url":"https://api.github.com/repos/DestinyItemManager/DIM/stargazers","contributors_url":"https://api.github.com/repos/DestinyItemManager/DIM/contributors","subscribers_url":"https://api.github.com/repos/DestinyItemManager/DIM/subscribers","subscription_url":"https://api.github.com/repos/DestinyItemManager/DIM/subscription","commits_url":"https://api.github.com/repos/DestinyItemManager/DIM/commits{/sha}","git_commits_url":"https://api.github.com/repos/DestinyItemManager/DIM/git/commits{/sha}","comments_url":"https://api.github.com/repos/DestinyItemManager/DIM/comments{/number}","issue_comment_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues/comments{/number}","contents_url":"https://api.github.com/repos/DestinyItemManager/DIM/contents/{+path}","compare_url":"https://api.github.com/repos/DestinyItemManager/DIM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DestinyItemManager/DIM/merges","archive_url":"https://api.github.com/repos/DestinyItemManager/DIM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DestinyItemManager/DIM/downloads","issues_url":"https://api.github.com/repos/DestinyItemManager/DIM/issues{/number}","pulls_url":"https://api.github.com/repos/DestinyItemManager/DIM/pulls{/number}","milestones_url":"https://api.github.com/repos/DestinyItemManager/DIM/milestones{/number}","notifications_url":"https://api.github.com/repos/DestinyItemManager/DIM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DestinyItemManager/DIM/labels{/name}","releases_url":"https://api.github.com/repos/DestinyItemManager/DIM/releases{/id}","deployments_url":"https://api.github.com/repos/DestinyItemManager/DIM/deployments","created_at":"2015-03-04T21:46:50Z","updated_at":"2016-11-16T02:37:11Z","pushed_at":"2016-11-17T19:18:37Z","git_url":"git://github.com/DestinyItemManager/DIM.git","ssh_url":"git@github.com:DestinyItemManager/DIM.git","clone_url":"https://github.com/DestinyItemManager/DIM.git","svn_url":"https://github.com/DestinyItemManager/DIM","homepage":"https://chrome.google.com/webstore/detail/destiny-item-manager/apghicjnekejhfancbkahkhdckhdagna","size":254440,"stargazers_count":398,"watchers_count":398,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":184,"mirror_url":null,"open_issues_count":105,"forks":184,"open_issues":105,"watchers":398,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/1191"},"html":{"href":"https://github.com/DestinyItemManager/DIM/pull/1191"},"issue":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/issues/1191"},"comments":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/issues/1191/comments"},"review_comments":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/1191/comments"},"review_comment":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/pulls/1191/commits"},"statuses":{"href":"https://api.github.com/repos/DestinyItemManager/DIM/statuses/5a418b1f00db2b84820baeb1eb151cbbb61a0936"}}}}
{"actor":{"display_login":"houndci-bot"}}