{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/voice-web/pulls/comments/142182885","pull_request_review_id":66506866,"id":142182885,"diff_hunk":"@@ -55,20 +56,14 @@ export default class API {\n   private getFileContents(filepath: string) {\n     return new Promise(\n       (res: (contents: string) => void, rej: (error: any) => void) => {\n-        fs.readFile(\n-          filepath,\n-          {\n-            contents: 'utf8',\n-          },","path":"server/src/lib/api.ts","position":21,"original_position":21,"commit_id":"b91a13acb032f356d82d4bf2a657d17e6cdd5345","original_commit_id":"b91a13acb032f356d82d4bf2a657d17e6cdd5345","user":{"login":"nevik","id":1099818,"avatar_url":"https://avatars0.githubusercontent.com/u/1099818?v=4","gravatar_id":"","url":"https://api.github.com/users/nevik","html_url":"https://github.com/nevik","followers_url":"https://api.github.com/users/nevik/followers","following_url":"https://api.github.com/users/nevik/following{/other_user}","gists_url":"https://api.github.com/users/nevik/gists{/gist_id}","starred_url":"https://api.github.com/users/nevik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevik/subscriptions","organizations_url":"https://api.github.com/users/nevik/orgs","repos_url":"https://api.github.com/users/nevik/repos","events_url":"https://api.github.com/users/nevik/events{/privacy}","received_events_url":"https://api.github.com/users/nevik/received_events","type":"User","site_admin":false},"body":"Once the typings were imported, TS complained about this parameter. Looking at the available signatures of `readFile`, I guessed that you currently want the one without specifying an encoding (which returns a Buffer).\r\n\r\nWhen you do specify an encoding, `readFile` already gives you a string. We could also change that here.\r\n\r\nSince I'm not sure about the effects of this change, and I can't properly test the backend, @mikehenrty please test this thoroughly :)","created_at":"2017-10-02T16:06:20Z","updated_at":"2017-10-02T16:06:20Z","html_url":"https://github.com/mozilla/voice-web/pull/479#discussion_r142182885","pull_request_url":"https://api.github.com/repos/mozilla/voice-web/pulls/479","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mozilla/voice-web/pulls/comments/142182885"},"html":{"href":"https://github.com/mozilla/voice-web/pull/479#discussion_r142182885"},"pull_request":{"href":"https://api.github.com/repos/mozilla/voice-web/pulls/479"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/voice-web/pulls/479","id":144221657,"html_url":"https://github.com/mozilla/voice-web/pull/479","diff_url":"https://github.com/mozilla/voice-web/pull/479.diff","patch_url":"https://github.com/mozilla/voice-web/pull/479.patch","issue_url":"https://api.github.com/repos/mozilla/voice-web/issues/479","number":479,"state":"open","locked":false,"title":"Use TS 'import' instead of 'require' where currently possible","user":{"login":"nevik","id":1099818,"avatar_url":"https://avatars0.githubusercontent.com/u/1099818?v=4","gravatar_id":"","url":"https://api.github.com/users/nevik","html_url":"https://github.com/nevik","followers_url":"https://api.github.com/users/nevik/followers","following_url":"https://api.github.com/users/nevik/following{/other_user}","gists_url":"https://api.github.com/users/nevik/gists{/gist_id}","starred_url":"https://api.github.com/users/nevik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevik/subscriptions","organizations_url":"https://api.github.com/users/nevik/orgs","repos_url":"https://api.github.com/users/nevik/repos","events_url":"https://api.github.com/users/nevik/events{/privacy}","received_events_url":"https://api.github.com/users/nevik/received_events","type":"User","site_admin":false},"body":"Since the Node typings are already part of package.json (though currently in version 7, we need to remember to change this if we decide to make Node 8 the minimum supported version), parts of the Node standard library can imported with `import` already, adding type support.\r\n\r\nI'm planning to add more typings for other libraries used, but that will go in a separate PR :)","created_at":"2017-10-02T16:04:27Z","updated_at":"2017-10-02T16:06:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ab7de3fa58da8e30276cdca6b4584855b31ea155","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/voice-web/pulls/479/commits","review_comments_url":"https://api.github.com/repos/mozilla/voice-web/pulls/479/comments","review_comment_url":"https://api.github.com/repos/mozilla/voice-web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/voice-web/issues/479/comments","statuses_url":"https://api.github.com/repos/mozilla/voice-web/statuses/b91a13acb032f356d82d4bf2a657d17e6cdd5345","head":{"label":"nevik:feature/use-import-instead-of-require","ref":"feature/use-import-instead-of-require","sha":"b91a13acb032f356d82d4bf2a657d17e6cdd5345","user":{"login":"nevik","id":1099818,"avatar_url":"https://avatars0.githubusercontent.com/u/1099818?v=4","gravatar_id":"","url":"https://api.github.com/users/nevik","html_url":"https://github.com/nevik","followers_url":"https://api.github.com/users/nevik/followers","following_url":"https://api.github.com/users/nevik/following{/other_user}","gists_url":"https://api.github.com/users/nevik/gists{/gist_id}","starred_url":"https://api.github.com/users/nevik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevik/subscriptions","organizations_url":"https://api.github.com/users/nevik/orgs","repos_url":"https://api.github.com/users/nevik/repos","events_url":"https://api.github.com/users/nevik/events{/privacy}","received_events_url":"https://api.github.com/users/nevik/received_events","type":"User","site_admin":false},"repo":{"id":100174224,"name":"voice-web","full_name":"nevik/voice-web","owner":{"login":"nevik","id":1099818,"avatar_url":"https://avatars0.githubusercontent.com/u/1099818?v=4","gravatar_id":"","url":"https://api.github.com/users/nevik","html_url":"https://github.com/nevik","followers_url":"https://api.github.com/users/nevik/followers","following_url":"https://api.github.com/users/nevik/following{/other_user}","gists_url":"https://api.github.com/users/nevik/gists{/gist_id}","starred_url":"https://api.github.com/users/nevik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevik/subscriptions","organizations_url":"https://api.github.com/users/nevik/orgs","repos_url":"https://api.github.com/users/nevik/repos","events_url":"https://api.github.com/users/nevik/events{/privacy}","received_events_url":"https://api.github.com/users/nevik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nevik/voice-web","description":"Responsive web, Android and iOS apps for collecting public voice data.","fork":true,"url":"https://api.github.com/repos/nevik/voice-web","forks_url":"https://api.github.com/repos/nevik/voice-web/forks","keys_url":"https://api.github.com/repos/nevik/voice-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nevik/voice-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nevik/voice-web/teams","hooks_url":"https://api.github.com/repos/nevik/voice-web/hooks","issue_events_url":"https://api.github.com/repos/nevik/voice-web/issues/events{/number}","events_url":"https://api.github.com/repos/nevik/voice-web/events","assignees_url":"https://api.github.com/repos/nevik/voice-web/assignees{/user}","branches_url":"https://api.github.com/repos/nevik/voice-web/branches{/branch}","tags_url":"https://api.github.com/repos/nevik/voice-web/tags","blobs_url":"https://api.github.com/repos/nevik/voice-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nevik/voice-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nevik/voice-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/nevik/voice-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nevik/voice-web/statuses/{sha}","languages_url":"https://api.github.com/repos/nevik/voice-web/languages","stargazers_url":"https://api.github.com/repos/nevik/voice-web/stargazers","contributors_url":"https://api.github.com/repos/nevik/voice-web/contributors","subscribers_url":"https://api.github.com/repos/nevik/voice-web/subscribers","subscription_url":"https://api.github.com/repos/nevik/voice-web/subscription","commits_url":"https://api.github.com/repos/nevik/voice-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/nevik/voice-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/nevik/voice-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/nevik/voice-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/nevik/voice-web/contents/{+path}","compare_url":"https://api.github.com/repos/nevik/voice-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nevik/voice-web/merges","archive_url":"https://api.github.com/repos/nevik/voice-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nevik/voice-web/downloads","issues_url":"https://api.github.com/repos/nevik/voice-web/issues{/number}","pulls_url":"https://api.github.com/repos/nevik/voice-web/pulls{/number}","milestones_url":"https://api.github.com/repos/nevik/voice-web/milestones{/number}","notifications_url":"https://api.github.com/repos/nevik/voice-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nevik/voice-web/labels{/name}","releases_url":"https://api.github.com/repos/nevik/voice-web/releases{/id}","deployments_url":"https://api.github.com/repos/nevik/voice-web/deployments","created_at":"2017-08-13T12:11:50Z","updated_at":"2017-08-13T12:11:52Z","pushed_at":"2017-10-02T16:01:07Z","git_url":"git://github.com/nevik/voice-web.git","ssh_url":"git@github.com:nevik/voice-web.git","clone_url":"https://github.com/nevik/voice-web.git","svn_url":"https://github.com/nevik/voice-web","homepage":"https://voice.mozilla.org/","size":25781,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"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":"mozilla:master","ref":"master","sha":"c7d8fc7f63d0b4647c2c35cee1aaa6795f060a00","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":90392762,"name":"voice-web","full_name":"mozilla/voice-web","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/voice-web","description":"Responsive web, Android and iOS apps for collecting public voice data.","fork":false,"url":"https://api.github.com/repos/mozilla/voice-web","forks_url":"https://api.github.com/repos/mozilla/voice-web/forks","keys_url":"https://api.github.com/repos/mozilla/voice-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/voice-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/voice-web/teams","hooks_url":"https://api.github.com/repos/mozilla/voice-web/hooks","issue_events_url":"https://api.github.com/repos/mozilla/voice-web/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/voice-web/events","assignees_url":"https://api.github.com/repos/mozilla/voice-web/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/voice-web/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/voice-web/tags","blobs_url":"https://api.github.com/repos/mozilla/voice-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/voice-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/voice-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/voice-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/voice-web/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/voice-web/languages","stargazers_url":"https://api.github.com/repos/mozilla/voice-web/stargazers","contributors_url":"https://api.github.com/repos/mozilla/voice-web/contributors","subscribers_url":"https://api.github.com/repos/mozilla/voice-web/subscribers","subscription_url":"https://api.github.com/repos/mozilla/voice-web/subscription","commits_url":"https://api.github.com/repos/mozilla/voice-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/voice-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/voice-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/voice-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/voice-web/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/voice-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/voice-web/merges","archive_url":"https://api.github.com/repos/mozilla/voice-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/voice-web/downloads","issues_url":"https://api.github.com/repos/mozilla/voice-web/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/voice-web/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/voice-web/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/voice-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/voice-web/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/voice-web/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/voice-web/deployments","created_at":"2017-05-05T15:53:07Z","updated_at":"2017-09-30T15:24:15Z","pushed_at":"2017-10-02T16:04:28Z","git_url":"git://github.com/mozilla/voice-web.git","ssh_url":"git@github.com:mozilla/voice-web.git","clone_url":"https://github.com/mozilla/voice-web.git","svn_url":"https://github.com/mozilla/voice-web","homepage":"https://voice.mozilla.org/","size":25796,"stargazers_count":447,"watchers_count":447,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":81,"mirror_url":null,"open_issues_count":70,"forks":81,"open_issues":70,"watchers":447,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/voice-web/pulls/479"},"html":{"href":"https://github.com/mozilla/voice-web/pull/479"},"issue":{"href":"https://api.github.com/repos/mozilla/voice-web/issues/479"},"comments":{"href":"https://api.github.com/repos/mozilla/voice-web/issues/479/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/voice-web/pulls/479/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/voice-web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/voice-web/pulls/479/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/voice-web/statuses/b91a13acb032f356d82d4bf2a657d17e6cdd5345"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nevik"}}