{"action":"created","comment":{"url":"https://api.github.com/repos/sirensolutions/kibiutils/pulls/comments/52232544","id":52232544,"diff_hunk":"@@ -33,6 +35,25 @@\n       }\n     };\n \n+    var slugifyId = function (id) {\n+      if (id == null) return;\n+\n+      var trans = {\n+        '/' : '-slash-',\n+        '\\\\?' : '-questionmark-',\n+        '\\\\&' : '-ampersand-',\n+        '=' : '-equal-',\n+        '#' : '-hash-'\n+      };\n+      _.each(trans, function (val, key) {\n+        var regex = new RegExp(key, 'g');\n+        id = id.replace(regex, val);\n+      });\n+      id = id.replace(/[\\s]+/g, '-');","path":"kibiutils.js","position":27,"original_position":27,"commit_id":"7ff34dc6e461200586cdfe63f8bb1b2c03ae1bff","original_commit_id":"7ff34dc6e461200586cdfe63f8bb1b2c03ae1bff","user":{"login":"szydan","id":900118,"avatar_url":"https://avatars.githubusercontent.com/u/900118?v=3","gravatar_id":"","url":"https://api.github.com/users/szydan","html_url":"https://github.com/szydan","followers_url":"https://api.github.com/users/szydan/followers","following_url":"https://api.github.com/users/szydan/following{/other_user}","gists_url":"https://api.github.com/users/szydan/gists{/gist_id}","starred_url":"https://api.github.com/users/szydan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szydan/subscriptions","organizations_url":"https://api.github.com/users/szydan/orgs","repos_url":"https://api.github.com/users/szydan/repos","events_url":"https://api.github.com/users/szydan/events{/privacy}","received_events_url":"https://api.github.com/users/szydan/received_events","type":"User","site_admin":false},"body":"Remove the lodash dependency please \r\nDepend on the whole lodash to do 1 single loop seems a little too much\r\n\r\ninstead do \r\n```\r\nfor (var key in trans) {\r\n  if (trans.hasOwnProperty(key)) {\r\n      var regex = new RegExp(key, 'g');\r\n      id = id.replace(regex, trans[key]); \r\n  }\r\n}\r\n```\r\n ","created_at":"2016-02-08T21:58:30Z","updated_at":"2016-02-08T21:58:30Z","html_url":"https://github.com/sirensolutions/kibiutils/pull/1#discussion_r52232544","pull_request_url":"https://api.github.com/repos/sirensolutions/kibiutils/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/sirensolutions/kibiutils/pulls/comments/52232544"},"html":{"href":"https://github.com/sirensolutions/kibiutils/pull/1#discussion_r52232544"},"pull_request":{"href":"https://api.github.com/repos/sirensolutions/kibiutils/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/sirensolutions/kibiutils/pulls/1","id":58630676,"html_url":"https://github.com/sirensolutions/kibiutils/pull/1","diff_url":"https://github.com/sirensolutions/kibiutils/pull/1.diff","patch_url":"https://github.com/sirensolutions/kibiutils/pull/1.patch","issue_url":"https://api.github.com/repos/sirensolutions/kibiutils/issues/1","number":1,"state":"open","locked":false,"title":"added slugifyId method","user":{"login":"scampi","id":795879,"avatar_url":"https://avatars.githubusercontent.com/u/795879?v=3","gravatar_id":"","url":"https://api.github.com/users/scampi","html_url":"https://github.com/scampi","followers_url":"https://api.github.com/users/scampi/followers","following_url":"https://api.github.com/users/scampi/following{/other_user}","gists_url":"https://api.github.com/users/scampi/gists{/gist_id}","starred_url":"https://api.github.com/users/scampi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scampi/subscriptions","organizations_url":"https://api.github.com/users/scampi/orgs","repos_url":"https://api.github.com/users/scampi/repos","events_url":"https://api.github.com/users/scampi/events{/privacy}","received_events_url":"https://api.github.com/users/scampi/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-08T16:18:05Z","updated_at":"2016-02-08T21:58:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8898aaa137d82672776d6ec1970a8dcd6e338c32","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sirensolutions/kibiutils/pulls/1/commits","review_comments_url":"https://api.github.com/repos/sirensolutions/kibiutils/pulls/1/comments","review_comment_url":"https://api.github.com/repos/sirensolutions/kibiutils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sirensolutions/kibiutils/issues/1/comments","statuses_url":"https://api.github.com/repos/sirensolutions/kibiutils/statuses/7ff34dc6e461200586cdfe63f8bb1b2c03ae1bff","head":{"label":"sirensolutions:slugifyId","ref":"slugifyId","sha":"7ff34dc6e461200586cdfe63f8bb1b2c03ae1bff","user":{"login":"sirensolutions","id":12463357,"avatar_url":"https://avatars.githubusercontent.com/u/12463357?v=3","gravatar_id":"","url":"https://api.github.com/users/sirensolutions","html_url":"https://github.com/sirensolutions","followers_url":"https://api.github.com/users/sirensolutions/followers","following_url":"https://api.github.com/users/sirensolutions/following{/other_user}","gists_url":"https://api.github.com/users/sirensolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/sirensolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirensolutions/subscriptions","organizations_url":"https://api.github.com/users/sirensolutions/orgs","repos_url":"https://api.github.com/users/sirensolutions/repos","events_url":"https://api.github.com/users/sirensolutions/events{/privacy}","received_events_url":"https://api.github.com/users/sirensolutions/received_events","type":"Organization","site_admin":false},"repo":{"id":41861141,"name":"kibiutils","full_name":"sirensolutions/kibiutils","owner":{"login":"sirensolutions","id":12463357,"avatar_url":"https://avatars.githubusercontent.com/u/12463357?v=3","gravatar_id":"","url":"https://api.github.com/users/sirensolutions","html_url":"https://github.com/sirensolutions","followers_url":"https://api.github.com/users/sirensolutions/followers","following_url":"https://api.github.com/users/sirensolutions/following{/other_user}","gists_url":"https://api.github.com/users/sirensolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/sirensolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirensolutions/subscriptions","organizations_url":"https://api.github.com/users/sirensolutions/orgs","repos_url":"https://api.github.com/users/sirensolutions/repos","events_url":"https://api.github.com/users/sirensolutions/events{/privacy}","received_events_url":"https://api.github.com/users/sirensolutions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sirensolutions/kibiutils","description":"Utility library for kibi project. This library is to keep functions which are shared between frontend and server side","fork":false,"url":"https://api.github.com/repos/sirensolutions/kibiutils","forks_url":"https://api.github.com/repos/sirensolutions/kibiutils/forks","keys_url":"https://api.github.com/repos/sirensolutions/kibiutils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sirensolutions/kibiutils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sirensolutions/kibiutils/teams","hooks_url":"https://api.github.com/repos/sirensolutions/kibiutils/hooks","issue_events_url":"https://api.github.com/repos/sirensolutions/kibiutils/issues/events{/number}","events_url":"https://api.github.com/repos/sirensolutions/kibiutils/events","assignees_url":"https://api.github.com/repos/sirensolutions/kibiutils/assignees{/user}","branches_url":"https://api.github.com/repos/sirensolutions/kibiutils/branches{/branch}","tags_url":"https://api.github.com/repos/sirensolutions/kibiutils/tags","blobs_url":"https://api.github.com/repos/sirensolutions/kibiutils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sirensolutions/kibiutils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sirensolutions/kibiutils/git/refs{/sha}","trees_url":"https://api.github.com/repos/sirensolutions/kibiutils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sirensolutions/kibiutils/statuses/{sha}","languages_url":"https://api.github.com/repos/sirensolutions/kibiutils/languages","stargazers_url":"https://api.github.com/repos/sirensolutions/kibiutils/stargazers","contributors_url":"https://api.github.com/repos/sirensolutions/kibiutils/contributors","subscribers_url":"https://api.github.com/repos/sirensolutions/kibiutils/subscribers","subscription_url":"https://api.github.com/repos/sirensolutions/kibiutils/subscription","commits_url":"https://api.github.com/repos/sirensolutions/kibiutils/commits{/sha}","git_commits_url":"https://api.github.com/repos/sirensolutions/kibiutils/git/commits{/sha}","comments_url":"https://api.github.com/repos/sirensolutions/kibiutils/comments{/number}","issue_comment_url":"https://api.github.com/repos/sirensolutions/kibiutils/issues/comments{/number}","contents_url":"https://api.github.com/repos/sirensolutions/kibiutils/contents/{+path}","compare_url":"https://api.github.com/repos/sirensolutions/kibiutils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sirensolutions/kibiutils/merges","archive_url":"https://api.github.com/repos/sirensolutions/kibiutils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sirensolutions/kibiutils/downloads","issues_url":"https://api.github.com/repos/sirensolutions/kibiutils/issues{/number}","pulls_url":"https://api.github.com/repos/sirensolutions/kibiutils/pulls{/number}","milestones_url":"https://api.github.com/repos/sirensolutions/kibiutils/milestones{/number}","notifications_url":"https://api.github.com/repos/sirensolutions/kibiutils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sirensolutions/kibiutils/labels{/name}","releases_url":"https://api.github.com/repos/sirensolutions/kibiutils/releases{/id}","deployments_url":"https://api.github.com/repos/sirensolutions/kibiutils/deployments","created_at":"2015-09-03T13:26:47Z","updated_at":"2015-10-16T13:31:19Z","pushed_at":"2016-02-08T16:18:06Z","git_url":"git://github.com/sirensolutions/kibiutils.git","ssh_url":"git@github.com:sirensolutions/kibiutils.git","clone_url":"https://github.com/sirensolutions/kibiutils.git","svn_url":"https://github.com/sirensolutions/kibiutils","homepage":null,"size":8,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"sirensolutions:master","ref":"master","sha":"659131e148082453255dd2196b02be9d7c8fb269","user":{"login":"sirensolutions","id":12463357,"avatar_url":"https://avatars.githubusercontent.com/u/12463357?v=3","gravatar_id":"","url":"https://api.github.com/users/sirensolutions","html_url":"https://github.com/sirensolutions","followers_url":"https://api.github.com/users/sirensolutions/followers","following_url":"https://api.github.com/users/sirensolutions/following{/other_user}","gists_url":"https://api.github.com/users/sirensolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/sirensolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirensolutions/subscriptions","organizations_url":"https://api.github.com/users/sirensolutions/orgs","repos_url":"https://api.github.com/users/sirensolutions/repos","events_url":"https://api.github.com/users/sirensolutions/events{/privacy}","received_events_url":"https://api.github.com/users/sirensolutions/received_events","type":"Organization","site_admin":false},"repo":{"id":41861141,"name":"kibiutils","full_name":"sirensolutions/kibiutils","owner":{"login":"sirensolutions","id":12463357,"avatar_url":"https://avatars.githubusercontent.com/u/12463357?v=3","gravatar_id":"","url":"https://api.github.com/users/sirensolutions","html_url":"https://github.com/sirensolutions","followers_url":"https://api.github.com/users/sirensolutions/followers","following_url":"https://api.github.com/users/sirensolutions/following{/other_user}","gists_url":"https://api.github.com/users/sirensolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/sirensolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirensolutions/subscriptions","organizations_url":"https://api.github.com/users/sirensolutions/orgs","repos_url":"https://api.github.com/users/sirensolutions/repos","events_url":"https://api.github.com/users/sirensolutions/events{/privacy}","received_events_url":"https://api.github.com/users/sirensolutions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sirensolutions/kibiutils","description":"Utility library for kibi project. This library is to keep functions which are shared between frontend and server side","fork":false,"url":"https://api.github.com/repos/sirensolutions/kibiutils","forks_url":"https://api.github.com/repos/sirensolutions/kibiutils/forks","keys_url":"https://api.github.com/repos/sirensolutions/kibiutils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sirensolutions/kibiutils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sirensolutions/kibiutils/teams","hooks_url":"https://api.github.com/repos/sirensolutions/kibiutils/hooks","issue_events_url":"https://api.github.com/repos/sirensolutions/kibiutils/issues/events{/number}","events_url":"https://api.github.com/repos/sirensolutions/kibiutils/events","assignees_url":"https://api.github.com/repos/sirensolutions/kibiutils/assignees{/user}","branches_url":"https://api.github.com/repos/sirensolutions/kibiutils/branches{/branch}","tags_url":"https://api.github.com/repos/sirensolutions/kibiutils/tags","blobs_url":"https://api.github.com/repos/sirensolutions/kibiutils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sirensolutions/kibiutils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sirensolutions/kibiutils/git/refs{/sha}","trees_url":"https://api.github.com/repos/sirensolutions/kibiutils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sirensolutions/kibiutils/statuses/{sha}","languages_url":"https://api.github.com/repos/sirensolutions/kibiutils/languages","stargazers_url":"https://api.github.com/repos/sirensolutions/kibiutils/stargazers","contributors_url":"https://api.github.com/repos/sirensolutions/kibiutils/contributors","subscribers_url":"https://api.github.com/repos/sirensolutions/kibiutils/subscribers","subscription_url":"https://api.github.com/repos/sirensolutions/kibiutils/subscription","commits_url":"https://api.github.com/repos/sirensolutions/kibiutils/commits{/sha}","git_commits_url":"https://api.github.com/repos/sirensolutions/kibiutils/git/commits{/sha}","comments_url":"https://api.github.com/repos/sirensolutions/kibiutils/comments{/number}","issue_comment_url":"https://api.github.com/repos/sirensolutions/kibiutils/issues/comments{/number}","contents_url":"https://api.github.com/repos/sirensolutions/kibiutils/contents/{+path}","compare_url":"https://api.github.com/repos/sirensolutions/kibiutils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sirensolutions/kibiutils/merges","archive_url":"https://api.github.com/repos/sirensolutions/kibiutils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sirensolutions/kibiutils/downloads","issues_url":"https://api.github.com/repos/sirensolutions/kibiutils/issues{/number}","pulls_url":"https://api.github.com/repos/sirensolutions/kibiutils/pulls{/number}","milestones_url":"https://api.github.com/repos/sirensolutions/kibiutils/milestones{/number}","notifications_url":"https://api.github.com/repos/sirensolutions/kibiutils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sirensolutions/kibiutils/labels{/name}","releases_url":"https://api.github.com/repos/sirensolutions/kibiutils/releases{/id}","deployments_url":"https://api.github.com/repos/sirensolutions/kibiutils/deployments","created_at":"2015-09-03T13:26:47Z","updated_at":"2015-10-16T13:31:19Z","pushed_at":"2016-02-08T16:18:06Z","git_url":"git://github.com/sirensolutions/kibiutils.git","ssh_url":"git@github.com:sirensolutions/kibiutils.git","clone_url":"https://github.com/sirensolutions/kibiutils.git","svn_url":"https://github.com/sirensolutions/kibiutils","homepage":null,"size":8,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sirensolutions/kibiutils/pulls/1"},"html":{"href":"https://github.com/sirensolutions/kibiutils/pull/1"},"issue":{"href":"https://api.github.com/repos/sirensolutions/kibiutils/issues/1"},"comments":{"href":"https://api.github.com/repos/sirensolutions/kibiutils/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/sirensolutions/kibiutils/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/sirensolutions/kibiutils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sirensolutions/kibiutils/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/sirensolutions/kibiutils/statuses/7ff34dc6e461200586cdfe63f8bb1b2c03ae1bff"}}}}