{"action":"created","comment":{"url":"https://api.github.com/repos/luin/ioredis/pulls/comments/35163923","id":35163923,"diff_hunk":"@@ -106,22 +129,37 @@ Command.prototype.getKeys = function () {\n           if (directive === 'GET') {\n             i += 1;\n             if (this.args[i] !== '#') {\n+              if (transform) {\n+                this.args[i] = transform(this.args[i]);\n+              }\n               this._keys.push(this.getKeyPart(this.args[i]));\n             }\n           } else if (directive === 'BY') {\n             i += 1;\n+            if (transform) {\n+              this.args[i] = transform(this.args[i]);\n+            }\n             this._keys.push(this.getKeyPart(this.args[i]));\n           } else if (directive === 'STORE') {\n             i += 1;\n+            if (transform) {\n+              this.args[i] = transform(this.args[i]);\n+            }\n             this._keys.push(this.args[i]);\n           }\n         }\n         break;\n       case 'zunionstore':\n       case 'zinterstore':\n+        if (transform) {\n+          this.args[0] = transform(this.args[0]);\n+        }\n         this._keys.push(this.args[0]);\n         keyStop = parseInt(this.args[1], 10) + 2;\n         for (i = 2; i < keyStop; ++i) {\n+          if (transform) {","path":"lib/command.js","position":80,"original_position":80,"commit_id":"374c1884e3beaa3306c572c2e48a5837167f5b9b","original_commit_id":"374c1884e3beaa3306c572c2e48a5837167f5b9b","user":{"login":"AVVS","id":1713617,"avatar_url":"https://avatars.githubusercontent.com/u/1713617?v=3","gravatar_id":"","url":"https://api.github.com/users/AVVS","html_url":"https://github.com/AVVS","followers_url":"https://api.github.com/users/AVVS/followers","following_url":"https://api.github.com/users/AVVS/following{/other_user}","gists_url":"https://api.github.com/users/AVVS/gists{/gist_id}","starred_url":"https://api.github.com/users/AVVS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AVVS/subscriptions","organizations_url":"https://api.github.com/users/AVVS/orgs","repos_url":"https://api.github.com/users/AVVS/repos","events_url":"https://api.github.com/users/AVVS/events{/privacy}","received_events_url":"https://api.github.com/users/AVVS/received_events","type":"User","site_admin":false},"body":"check in a cycle is not the best thing, imo we should create a function which is either a noop (gives back the input) or the transformed input. that way check is only performed once. this an be applied to all the other if (transform)","created_at":"2015-07-21T22:48:31Z","updated_at":"2015-07-21T22:48:31Z","html_url":"https://github.com/luin/ioredis/pull/105#discussion_r35163923","pull_request_url":"https://api.github.com/repos/luin/ioredis/pulls/105","_links":{"self":{"href":"https://api.github.com/repos/luin/ioredis/pulls/comments/35163923"},"html":{"href":"https://github.com/luin/ioredis/pull/105#discussion_r35163923"},"pull_request":{"href":"https://api.github.com/repos/luin/ioredis/pulls/105"}}},"pull_request":{"url":"https://api.github.com/repos/luin/ioredis/pulls/105","id":40498822,"html_url":"https://github.com/luin/ioredis/pull/105","diff_url":"https://github.com/luin/ioredis/pull/105.diff","patch_url":"https://github.com/luin/ioredis/pull/105.patch","issue_url":"https://api.github.com/repos/luin/ioredis/issues/105","number":105,"state":"open","locked":false,"title":"Add support for transparent key prefixing. Close #95","user":{"login":"dguo","id":2763135,"avatar_url":"https://avatars.githubusercontent.com/u/2763135?v=3","gravatar_id":"","url":"https://api.github.com/users/dguo","html_url":"https://github.com/dguo","followers_url":"https://api.github.com/users/dguo/followers","following_url":"https://api.github.com/users/dguo/following{/other_user}","gists_url":"https://api.github.com/users/dguo/gists{/gist_id}","starred_url":"https://api.github.com/users/dguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dguo/subscriptions","organizations_url":"https://api.github.com/users/dguo/orgs","repos_url":"https://api.github.com/users/dguo/repos","events_url":"https://api.github.com/users/dguo/events{/privacy}","received_events_url":"https://api.github.com/users/dguo/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-21T20:08:37Z","updated_at":"2015-07-21T22:48:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa2a8cfa1e230186bb28ba15d0e0b2a91513a0f8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/luin/ioredis/pulls/105/commits","review_comments_url":"https://api.github.com/repos/luin/ioredis/pulls/105/comments","review_comment_url":"https://api.github.com/repos/luin/ioredis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/luin/ioredis/issues/105/comments","statuses_url":"https://api.github.com/repos/luin/ioredis/statuses/374c1884e3beaa3306c572c2e48a5837167f5b9b","head":{"label":"dguo:key_prefixing","ref":"key_prefixing","sha":"374c1884e3beaa3306c572c2e48a5837167f5b9b","user":{"login":"dguo","id":2763135,"avatar_url":"https://avatars.githubusercontent.com/u/2763135?v=3","gravatar_id":"","url":"https://api.github.com/users/dguo","html_url":"https://github.com/dguo","followers_url":"https://api.github.com/users/dguo/followers","following_url":"https://api.github.com/users/dguo/following{/other_user}","gists_url":"https://api.github.com/users/dguo/gists{/gist_id}","starred_url":"https://api.github.com/users/dguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dguo/subscriptions","organizations_url":"https://api.github.com/users/dguo/orgs","repos_url":"https://api.github.com/users/dguo/repos","events_url":"https://api.github.com/users/dguo/events{/privacy}","received_events_url":"https://api.github.com/users/dguo/received_events","type":"User","site_admin":false},"repo":{"id":38849407,"name":"ioredis","full_name":"dguo/ioredis","owner":{"login":"dguo","id":2763135,"avatar_url":"https://avatars.githubusercontent.com/u/2763135?v=3","gravatar_id":"","url":"https://api.github.com/users/dguo","html_url":"https://github.com/dguo","followers_url":"https://api.github.com/users/dguo/followers","following_url":"https://api.github.com/users/dguo/following{/other_user}","gists_url":"https://api.github.com/users/dguo/gists{/gist_id}","starred_url":"https://api.github.com/users/dguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dguo/subscriptions","organizations_url":"https://api.github.com/users/dguo/orgs","repos_url":"https://api.github.com/users/dguo/repos","events_url":"https://api.github.com/users/dguo/events{/privacy}","received_events_url":"https://api.github.com/users/dguo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dguo/ioredis","description":"A delightful, performance-focused and full-featured Redis client for Node and io.js.","fork":true,"url":"https://api.github.com/repos/dguo/ioredis","forks_url":"https://api.github.com/repos/dguo/ioredis/forks","keys_url":"https://api.github.com/repos/dguo/ioredis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dguo/ioredis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dguo/ioredis/teams","hooks_url":"https://api.github.com/repos/dguo/ioredis/hooks","issue_events_url":"https://api.github.com/repos/dguo/ioredis/issues/events{/number}","events_url":"https://api.github.com/repos/dguo/ioredis/events","assignees_url":"https://api.github.com/repos/dguo/ioredis/assignees{/user}","branches_url":"https://api.github.com/repos/dguo/ioredis/branches{/branch}","tags_url":"https://api.github.com/repos/dguo/ioredis/tags","blobs_url":"https://api.github.com/repos/dguo/ioredis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dguo/ioredis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dguo/ioredis/git/refs{/sha}","trees_url":"https://api.github.com/repos/dguo/ioredis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dguo/ioredis/statuses/{sha}","languages_url":"https://api.github.com/repos/dguo/ioredis/languages","stargazers_url":"https://api.github.com/repos/dguo/ioredis/stargazers","contributors_url":"https://api.github.com/repos/dguo/ioredis/contributors","subscribers_url":"https://api.github.com/repos/dguo/ioredis/subscribers","subscription_url":"https://api.github.com/repos/dguo/ioredis/subscription","commits_url":"https://api.github.com/repos/dguo/ioredis/commits{/sha}","git_commits_url":"https://api.github.com/repos/dguo/ioredis/git/commits{/sha}","comments_url":"https://api.github.com/repos/dguo/ioredis/comments{/number}","issue_comment_url":"https://api.github.com/repos/dguo/ioredis/issues/comments{/number}","contents_url":"https://api.github.com/repos/dguo/ioredis/contents/{+path}","compare_url":"https://api.github.com/repos/dguo/ioredis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dguo/ioredis/merges","archive_url":"https://api.github.com/repos/dguo/ioredis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dguo/ioredis/downloads","issues_url":"https://api.github.com/repos/dguo/ioredis/issues{/number}","pulls_url":"https://api.github.com/repos/dguo/ioredis/pulls{/number}","milestones_url":"https://api.github.com/repos/dguo/ioredis/milestones{/number}","notifications_url":"https://api.github.com/repos/dguo/ioredis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dguo/ioredis/labels{/name}","releases_url":"https://api.github.com/repos/dguo/ioredis/releases{/id}","created_at":"2015-07-09T22:56:27Z","updated_at":"2015-07-09T22:56:27Z","pushed_at":"2015-07-21T20:14:42Z","git_url":"git://github.com/dguo/ioredis.git","ssh_url":"git@github.com:dguo/ioredis.git","clone_url":"https://github.com/dguo/ioredis.git","svn_url":"https://github.com/dguo/ioredis","homepage":"","size":776,"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":"master"}},"base":{"label":"luin:master","ref":"master","sha":"03023900d421579736456d3693f0ba58069feab8","user":{"login":"luin","id":635902,"avatar_url":"https://avatars.githubusercontent.com/u/635902?v=3","gravatar_id":"","url":"https://api.github.com/users/luin","html_url":"https://github.com/luin","followers_url":"https://api.github.com/users/luin/followers","following_url":"https://api.github.com/users/luin/following{/other_user}","gists_url":"https://api.github.com/users/luin/gists{/gist_id}","starred_url":"https://api.github.com/users/luin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luin/subscriptions","organizations_url":"https://api.github.com/users/luin/orgs","repos_url":"https://api.github.com/users/luin/repos","events_url":"https://api.github.com/users/luin/events{/privacy}","received_events_url":"https://api.github.com/users/luin/received_events","type":"User","site_admin":false},"repo":{"id":33293613,"name":"ioredis","full_name":"luin/ioredis","owner":{"login":"luin","id":635902,"avatar_url":"https://avatars.githubusercontent.com/u/635902?v=3","gravatar_id":"","url":"https://api.github.com/users/luin","html_url":"https://github.com/luin","followers_url":"https://api.github.com/users/luin/followers","following_url":"https://api.github.com/users/luin/following{/other_user}","gists_url":"https://api.github.com/users/luin/gists{/gist_id}","starred_url":"https://api.github.com/users/luin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luin/subscriptions","organizations_url":"https://api.github.com/users/luin/orgs","repos_url":"https://api.github.com/users/luin/repos","events_url":"https://api.github.com/users/luin/events{/privacy}","received_events_url":"https://api.github.com/users/luin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/luin/ioredis","description":"A delightful, performance-focused and full-featured Redis client for Node and io.js.","fork":false,"url":"https://api.github.com/repos/luin/ioredis","forks_url":"https://api.github.com/repos/luin/ioredis/forks","keys_url":"https://api.github.com/repos/luin/ioredis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luin/ioredis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luin/ioredis/teams","hooks_url":"https://api.github.com/repos/luin/ioredis/hooks","issue_events_url":"https://api.github.com/repos/luin/ioredis/issues/events{/number}","events_url":"https://api.github.com/repos/luin/ioredis/events","assignees_url":"https://api.github.com/repos/luin/ioredis/assignees{/user}","branches_url":"https://api.github.com/repos/luin/ioredis/branches{/branch}","tags_url":"https://api.github.com/repos/luin/ioredis/tags","blobs_url":"https://api.github.com/repos/luin/ioredis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luin/ioredis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luin/ioredis/git/refs{/sha}","trees_url":"https://api.github.com/repos/luin/ioredis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luin/ioredis/statuses/{sha}","languages_url":"https://api.github.com/repos/luin/ioredis/languages","stargazers_url":"https://api.github.com/repos/luin/ioredis/stargazers","contributors_url":"https://api.github.com/repos/luin/ioredis/contributors","subscribers_url":"https://api.github.com/repos/luin/ioredis/subscribers","subscription_url":"https://api.github.com/repos/luin/ioredis/subscription","commits_url":"https://api.github.com/repos/luin/ioredis/commits{/sha}","git_commits_url":"https://api.github.com/repos/luin/ioredis/git/commits{/sha}","comments_url":"https://api.github.com/repos/luin/ioredis/comments{/number}","issue_comment_url":"https://api.github.com/repos/luin/ioredis/issues/comments{/number}","contents_url":"https://api.github.com/repos/luin/ioredis/contents/{+path}","compare_url":"https://api.github.com/repos/luin/ioredis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luin/ioredis/merges","archive_url":"https://api.github.com/repos/luin/ioredis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luin/ioredis/downloads","issues_url":"https://api.github.com/repos/luin/ioredis/issues{/number}","pulls_url":"https://api.github.com/repos/luin/ioredis/pulls{/number}","milestones_url":"https://api.github.com/repos/luin/ioredis/milestones{/number}","notifications_url":"https://api.github.com/repos/luin/ioredis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luin/ioredis/labels{/name}","releases_url":"https://api.github.com/repos/luin/ioredis/releases{/id}","created_at":"2015-04-02T06:42:46Z","updated_at":"2015-07-21T15:04:06Z","pushed_at":"2015-07-21T20:08:38Z","git_url":"git://github.com/luin/ioredis.git","ssh_url":"git@github.com:luin/ioredis.git","clone_url":"https://github.com/luin/ioredis.git","svn_url":"https://github.com/luin/ioredis","homepage":"","size":1694,"stargazers_count":973,"watchers_count":973,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":16,"forks":39,"open_issues":16,"watchers":973,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/luin/ioredis/pulls/105"},"html":{"href":"https://github.com/luin/ioredis/pull/105"},"issue":{"href":"https://api.github.com/repos/luin/ioredis/issues/105"},"comments":{"href":"https://api.github.com/repos/luin/ioredis/issues/105/comments"},"review_comments":{"href":"https://api.github.com/repos/luin/ioredis/pulls/105/comments"},"review_comment":{"href":"https://api.github.com/repos/luin/ioredis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/luin/ioredis/pulls/105/commits"},"statuses":{"href":"https://api.github.com/repos/luin/ioredis/statuses/374c1884e3beaa3306c572c2e48a5837167f5b9b"}}}}