{"action":"created","comment":{"url":"https://api.github.com/repos/wireapp/wire-web-packages/pulls/comments/175437762","pull_request_review_id":104964855,"id":175437762,"diff_hunk":"@@ -0,0 +1,96 @@\n+/*\n+ * Wire\n+ * Copyright (C) 2018 Wire Swiss GmbH\n+ *\n+ * This program is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU General Public License as published by\n+ * the Free Software Foundation, either version 3 of the License, or\n+ * (at your option) any later version.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+ * GNU General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with this program. If not, see http://www.gnu.org/licenses/.\n+ *\n+ */\n+\n+/* eslint no-magic-numbers: \"off\" */\n+\n+class Types {\n+  static readonly ARRAY = 1;\n+  static readonly BOOL = 2;\n+  static readonly BREAK = 3;\n+  static readonly BYTES = 4;\n+  static readonly FLOAT16 = 5;\n+  static readonly FLOAT32 = 6;\n+  static readonly FLOAT64 = 7;\n+  static readonly UINT8 = 8;\n+  static readonly UINT16 = 9;\n+  static readonly UINT32 = 10;\n+  static readonly UINT64 = 11;\n+  static readonly INT8 = 12;\n+  static readonly INT16 = 13;\n+  static readonly INT32 = 14;\n+  static readonly INT64 = 15;\n+  static readonly NULL = 16;\n+  static readonly OBJECT = 17;\n+  static readonly TAGGED = 18;\n+  static readonly TEXT = 19;\n+  static readonly UNDEFINED = 20;\n+\n+  private constructor() {\n+    throw new Error(`Can't create instance of singleton`);\n+  }\n+\n+  static major(type: Types): number {\n+    switch (type) {\n+      case Types.ARRAY:\n+        return 4;\n+      case Types.BOOL:\n+        return 7;\n+      case Types.BREAK:\n+        return 7;\n+      case Types.BYTES:\n+        return 2;\n+      case Types.FLOAT16:\n+        return 7;\n+      case Types.FLOAT32:\n+        return 7;\n+      case Types.FLOAT64:\n+        return 7;\n+      case Types.UINT8:\n+        return 0;\n+      case Types.UINT16:\n+        return 0;\n+      case Types.UINT32:\n+        return 0;\n+      case Types.UINT64:\n+        return 0;\n+      case Types.INT8:\n+        return 1;\n+      case Types.INT16:\n+        return 1;\n+      case Types.INT32:\n+        return 1;\n+      case Types.INT64:\n+        return 1;\n+      case Types.NULL:\n+        return 7;\n+      case Types.OBJECT:\n+        return 5;\n+      case Types.TAGGED:\n+        return 6;\n+      case Types.TEXT:\n+        return 3;\n+      case Types.UNDEFINED:\n+        return 7;","path":"packages/cbor/src/main/cbor/Types.ts","position":89,"original_position":89,"commit_id":"6832451e240e1f679cbd91a0b58a87b051165575","original_commit_id":"6832451e240e1f679cbd91a0b58a87b051165575","user":{"login":"lipis","id":125676,"avatar_url":"https://avatars1.githubusercontent.com/u/125676?v=4","gravatar_id":"","url":"https://api.github.com/users/lipis","html_url":"https://github.com/lipis","followers_url":"https://api.github.com/users/lipis/followers","following_url":"https://api.github.com/users/lipis/following{/other_user}","gists_url":"https://api.github.com/users/lipis/gists{/gist_id}","starred_url":"https://api.github.com/users/lipis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lipis/subscriptions","organizations_url":"https://api.github.com/users/lipis/orgs","repos_url":"https://api.github.com/users/lipis/repos","events_url":"https://api.github.com/users/lipis/events{/privacy}","received_events_url":"https://api.github.com/users/lipis/received_events","type":"User","site_admin":false},"body":"Can we name these magic numbers?! What are these 3, 6, 7?","created_at":"2018-03-19T13:43:59Z","updated_at":"2018-03-19T13:43:59Z","html_url":"https://github.com/wireapp/wire-web-packages/pull/379#discussion_r175437762","pull_request_url":"https://api.github.com/repos/wireapp/wire-web-packages/pulls/379","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/wireapp/wire-web-packages/pulls/comments/175437762"},"html":{"href":"https://github.com/wireapp/wire-web-packages/pull/379#discussion_r175437762"},"pull_request":{"href":"https://api.github.com/repos/wireapp/wire-web-packages/pulls/379"}}},"pull_request":{"url":"https://api.github.com/repos/wireapp/wire-web-packages/pulls/379","id":175754182,"html_url":"https://github.com/wireapp/wire-web-packages/pull/379","diff_url":"https://github.com/wireapp/wire-web-packages/pull/379.diff","patch_url":"https://github.com/wireapp/wire-web-packages/pull/379.patch","issue_url":"https://api.github.com/repos/wireapp/wire-web-packages/issues/379","number":379,"state":"open","locked":false,"title":"refactor(cbor): Rewrite to TypeScript","user":{"login":"ffflorian","id":5497598,"avatar_url":"https://avatars3.githubusercontent.com/u/5497598?v=4","gravatar_id":"","url":"https://api.github.com/users/ffflorian","html_url":"https://github.com/ffflorian","followers_url":"https://api.github.com/users/ffflorian/followers","following_url":"https://api.github.com/users/ffflorian/following{/other_user}","gists_url":"https://api.github.com/users/ffflorian/gists{/gist_id}","starred_url":"https://api.github.com/users/ffflorian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ffflorian/subscriptions","organizations_url":"https://api.github.com/users/ffflorian/orgs","repos_url":"https://api.github.com/users/ffflorian/repos","events_url":"https://api.github.com/users/ffflorian/events{/privacy}","received_events_url":"https://api.github.com/users/ffflorian/received_events","type":"User","site_admin":false},"body":":boom: ","created_at":"2018-03-18T14:33:31Z","updated_at":"2018-03-19T13:43:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0df85d6a25566bfb26e3222f80db2155653eaa73","assignee":null,"assignees":[],"requested_reviewers":[{"login":"bennyn","id":469989,"avatar_url":"https://avatars3.githubusercontent.com/u/469989?v=4","gravatar_id":"","url":"https://api.github.com/users/bennyn","html_url":"https://github.com/bennyn","followers_url":"https://api.github.com/users/bennyn/followers","following_url":"https://api.github.com/users/bennyn/following{/other_user}","gists_url":"https://api.github.com/users/bennyn/gists{/gist_id}","starred_url":"https://api.github.com/users/bennyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bennyn/subscriptions","organizations_url":"https://api.github.com/users/bennyn/orgs","repos_url":"https://api.github.com/users/bennyn/repos","events_url":"https://api.github.com/users/bennyn/events{/privacy}","received_events_url":"https://api.github.com/users/bennyn/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wireapp/wire-web-packages/pulls/379/commits","review_comments_url":"https://api.github.com/repos/wireapp/wire-web-packages/pulls/379/comments","review_comment_url":"https://api.github.com/repos/wireapp/wire-web-packages/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wireapp/wire-web-packages/issues/379/comments","statuses_url":"https://api.github.com/repos/wireapp/wire-web-packages/statuses/6832451e240e1f679cbd91a0b58a87b051165575","head":{"label":"wireapp:feat/cbor-typescript","ref":"feat/cbor-typescript","sha":"6832451e240e1f679cbd91a0b58a87b051165575","user":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars3.githubusercontent.com/u/16047324?v=4","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"repo":{"id":108842542,"name":"wire-web-packages","full_name":"wireapp/wire-web-packages","owner":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars3.githubusercontent.com/u/16047324?v=4","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wireapp/wire-web-packages","description":"Collection of npm modules created by Wire's web team.","fork":false,"url":"https://api.github.com/repos/wireapp/wire-web-packages","forks_url":"https://api.github.com/repos/wireapp/wire-web-packages/forks","keys_url":"https://api.github.com/repos/wireapp/wire-web-packages/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wireapp/wire-web-packages/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wireapp/wire-web-packages/teams","hooks_url":"https://api.github.com/repos/wireapp/wire-web-packages/hooks","issue_events_url":"https://api.github.com/repos/wireapp/wire-web-packages/issues/events{/number}","events_url":"https://api.github.com/repos/wireapp/wire-web-packages/events","assignees_url":"https://api.github.com/repos/wireapp/wire-web-packages/assignees{/user}","branches_url":"https://api.github.com/repos/wireapp/wire-web-packages/branches{/branch}","tags_url":"https://api.github.com/repos/wireapp/wire-web-packages/tags","blobs_url":"https://api.github.com/repos/wireapp/wire-web-packages/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wireapp/wire-web-packages/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wireapp/wire-web-packages/git/refs{/sha}","trees_url":"https://api.github.com/repos/wireapp/wire-web-packages/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wireapp/wire-web-packages/statuses/{sha}","languages_url":"https://api.github.com/repos/wireapp/wire-web-packages/languages","stargazers_url":"https://api.github.com/repos/wireapp/wire-web-packages/stargazers","contributors_url":"https://api.github.com/repos/wireapp/wire-web-packages/contributors","subscribers_url":"https://api.github.com/repos/wireapp/wire-web-packages/subscribers","subscription_url":"https://api.github.com/repos/wireapp/wire-web-packages/subscription","commits_url":"https://api.github.com/repos/wireapp/wire-web-packages/commits{/sha}","git_commits_url":"https://api.github.com/repos/wireapp/wire-web-packages/git/commits{/sha}","comments_url":"https://api.github.com/repos/wireapp/wire-web-packages/comments{/number}","issue_comment_url":"https://api.github.com/repos/wireapp/wire-web-packages/issues/comments{/number}","contents_url":"https://api.github.com/repos/wireapp/wire-web-packages/contents/{+path}","compare_url":"https://api.github.com/repos/wireapp/wire-web-packages/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wireapp/wire-web-packages/merges","archive_url":"https://api.github.com/repos/wireapp/wire-web-packages/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wireapp/wire-web-packages/downloads","issues_url":"https://api.github.com/repos/wireapp/wire-web-packages/issues{/number}","pulls_url":"https://api.github.com/repos/wireapp/wire-web-packages/pulls{/number}","milestones_url":"https://api.github.com/repos/wireapp/wire-web-packages/milestones{/number}","notifications_url":"https://api.github.com/repos/wireapp/wire-web-packages/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wireapp/wire-web-packages/labels{/name}","releases_url":"https://api.github.com/repos/wireapp/wire-web-packages/releases{/id}","deployments_url":"https://api.github.com/repos/wireapp/wire-web-packages/deployments","created_at":"2017-10-30T11:39:18Z","updated_at":"2018-03-19T13:41:17Z","pushed_at":"2018-03-19T13:41:17Z","git_url":"git://github.com/wireapp/wire-web-packages.git","ssh_url":"git@github.com:wireapp/wire-web-packages.git","clone_url":"https://github.com/wireapp/wire-web-packages.git","svn_url":"https://github.com/wireapp/wire-web-packages","homepage":"","size":2578,"stargazers_count":12,"watchers_count":12,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":3,"open_issues":11,"watchers":12,"default_branch":"master"}},"base":{"label":"wireapp:master","ref":"master","sha":"249d74b9c31e3a38b570a555564f3e00b11d036d","user":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars3.githubusercontent.com/u/16047324?v=4","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"repo":{"id":108842542,"name":"wire-web-packages","full_name":"wireapp/wire-web-packages","owner":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars3.githubusercontent.com/u/16047324?v=4","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wireapp/wire-web-packages","description":"Collection of npm modules created by Wire's web team.","fork":false,"url":"https://api.github.com/repos/wireapp/wire-web-packages","forks_url":"https://api.github.com/repos/wireapp/wire-web-packages/forks","keys_url":"https://api.github.com/repos/wireapp/wire-web-packages/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wireapp/wire-web-packages/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wireapp/wire-web-packages/teams","hooks_url":"https://api.github.com/repos/wireapp/wire-web-packages/hooks","issue_events_url":"https://api.github.com/repos/wireapp/wire-web-packages/issues/events{/number}","events_url":"https://api.github.com/repos/wireapp/wire-web-packages/events","assignees_url":"https://api.github.com/repos/wireapp/wire-web-packages/assignees{/user}","branches_url":"https://api.github.com/repos/wireapp/wire-web-packages/branches{/branch}","tags_url":"https://api.github.com/repos/wireapp/wire-web-packages/tags","blobs_url":"https://api.github.com/repos/wireapp/wire-web-packages/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wireapp/wire-web-packages/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wireapp/wire-web-packages/git/refs{/sha}","trees_url":"https://api.github.com/repos/wireapp/wire-web-packages/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wireapp/wire-web-packages/statuses/{sha}","languages_url":"https://api.github.com/repos/wireapp/wire-web-packages/languages","stargazers_url":"https://api.github.com/repos/wireapp/wire-web-packages/stargazers","contributors_url":"https://api.github.com/repos/wireapp/wire-web-packages/contributors","subscribers_url":"https://api.github.com/repos/wireapp/wire-web-packages/subscribers","subscription_url":"https://api.github.com/repos/wireapp/wire-web-packages/subscription","commits_url":"https://api.github.com/repos/wireapp/wire-web-packages/commits{/sha}","git_commits_url":"https://api.github.com/repos/wireapp/wire-web-packages/git/commits{/sha}","comments_url":"https://api.github.com/repos/wireapp/wire-web-packages/comments{/number}","issue_comment_url":"https://api.github.com/repos/wireapp/wire-web-packages/issues/comments{/number}","contents_url":"https://api.github.com/repos/wireapp/wire-web-packages/contents/{+path}","compare_url":"https://api.github.com/repos/wireapp/wire-web-packages/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wireapp/wire-web-packages/merges","archive_url":"https://api.github.com/repos/wireapp/wire-web-packages/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wireapp/wire-web-packages/downloads","issues_url":"https://api.github.com/repos/wireapp/wire-web-packages/issues{/number}","pulls_url":"https://api.github.com/repos/wireapp/wire-web-packages/pulls{/number}","milestones_url":"https://api.github.com/repos/wireapp/wire-web-packages/milestones{/number}","notifications_url":"https://api.github.com/repos/wireapp/wire-web-packages/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wireapp/wire-web-packages/labels{/name}","releases_url":"https://api.github.com/repos/wireapp/wire-web-packages/releases{/id}","deployments_url":"https://api.github.com/repos/wireapp/wire-web-packages/deployments","created_at":"2017-10-30T11:39:18Z","updated_at":"2018-03-19T13:41:17Z","pushed_at":"2018-03-19T13:41:17Z","git_url":"git://github.com/wireapp/wire-web-packages.git","ssh_url":"git@github.com:wireapp/wire-web-packages.git","clone_url":"https://github.com/wireapp/wire-web-packages.git","svn_url":"https://github.com/wireapp/wire-web-packages","homepage":"","size":2578,"stargazers_count":12,"watchers_count":12,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":3,"open_issues":11,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wireapp/wire-web-packages/pulls/379"},"html":{"href":"https://github.com/wireapp/wire-web-packages/pull/379"},"issue":{"href":"https://api.github.com/repos/wireapp/wire-web-packages/issues/379"},"comments":{"href":"https://api.github.com/repos/wireapp/wire-web-packages/issues/379/comments"},"review_comments":{"href":"https://api.github.com/repos/wireapp/wire-web-packages/pulls/379/comments"},"review_comment":{"href":"https://api.github.com/repos/wireapp/wire-web-packages/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wireapp/wire-web-packages/pulls/379/commits"},"statuses":{"href":"https://api.github.com/repos/wireapp/wire-web-packages/statuses/6832451e240e1f679cbd91a0b58a87b051165575"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"lipis"}}