{"action":"created","issue":{"url":"https://api.github.com/repos/TEAMMATES/teammates/issues/4810","repository_url":"https://api.github.com/repos/TEAMMATES/teammates","labels_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/4810/labels{/name}","comments_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/4810/comments","events_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/4810/events","html_url":"https://github.com/TEAMMATES/teammates/pull/4810","id":135224740,"number":4810,"title":"The function isBlank in multiple JavaScript files can be simplified #3922","user":{"login":"Gisonrg","id":4332224,"avatar_url":"https://avatars.githubusercontent.com/u/4332224?v=3","gravatar_id":"","url":"https://api.github.com/users/Gisonrg","html_url":"https://github.com/Gisonrg","followers_url":"https://api.github.com/users/Gisonrg/followers","following_url":"https://api.github.com/users/Gisonrg/following{/other_user}","gists_url":"https://api.github.com/users/Gisonrg/gists{/gist_id}","starred_url":"https://api.github.com/users/Gisonrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gisonrg/subscriptions","organizations_url":"https://api.github.com/users/Gisonrg/orgs","repos_url":"https://api.github.com/users/Gisonrg/repos","events_url":"https://api.github.com/users/Gisonrg/events{/privacy}","received_events_url":"https://api.github.com/users/Gisonrg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TEAMMATES/teammates/labels/s.ToMerge","name":"s.ToMerge","color":"38923D"}],"state":"open","locked":false,"assignee":{"login":"wkurniawan07","id":7261051,"avatar_url":"https://avatars.githubusercontent.com/u/7261051?v=3","gravatar_id":"","url":"https://api.github.com/users/wkurniawan07","html_url":"https://github.com/wkurniawan07","followers_url":"https://api.github.com/users/wkurniawan07/followers","following_url":"https://api.github.com/users/wkurniawan07/following{/other_user}","gists_url":"https://api.github.com/users/wkurniawan07/gists{/gist_id}","starred_url":"https://api.github.com/users/wkurniawan07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkurniawan07/subscriptions","organizations_url":"https://api.github.com/users/wkurniawan07/orgs","repos_url":"https://api.github.com/users/wkurniawan07/repos","events_url":"https://api.github.com/users/wkurniawan07/events{/privacy}","received_events_url":"https://api.github.com/users/wkurniawan07/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2016-02-21T16:27:55Z","updated_at":"2016-02-22T09:30:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/4810","html_url":"https://github.com/TEAMMATES/teammates/pull/4810","diff_url":"https://github.com/TEAMMATES/teammates/pull/4810.diff","patch_url":"https://github.com/TEAMMATES/teammates/pull/4810.patch"},"body":"Fixes #3922 \r\n\r\nUpdated function:\r\n```javascript\r\nfunction isBlank(str) {\r\n    if (typeof str !== 'string' && !(str instanceof String)) {\r\n        return false;\r\n    }\r\n    return str.trim() === '';\r\n}\r\n```\r\nWill first check if the input is of type String. Then use the `trim` method and compare it with empty string.\r\n\r\n@wkurniawan07 Can help to review? :smiley: "},"comment":{"url":"https://api.github.com/repos/TEAMMATES/teammates/issues/comments/187091983","html_url":"https://github.com/TEAMMATES/teammates/pull/4810#issuecomment-187091983","issue_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/4810","id":187091983,"user":{"login":"Gisonrg","id":4332224,"avatar_url":"https://avatars.githubusercontent.com/u/4332224?v=3","gravatar_id":"","url":"https://api.github.com/users/Gisonrg","html_url":"https://github.com/Gisonrg","followers_url":"https://api.github.com/users/Gisonrg/followers","following_url":"https://api.github.com/users/Gisonrg/following{/other_user}","gists_url":"https://api.github.com/users/Gisonrg/gists{/gist_id}","starred_url":"https://api.github.com/users/Gisonrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gisonrg/subscriptions","organizations_url":"https://api.github.com/users/Gisonrg/orgs","repos_url":"https://api.github.com/users/Gisonrg/repos","events_url":"https://api.github.com/users/Gisonrg/events{/privacy}","received_events_url":"https://api.github.com/users/Gisonrg/received_events","type":"User","site_admin":false},"created_at":"2016-02-22T09:30:24Z","updated_at":"2016-02-22T09:30:24Z","body":"Thanks! :ok_hand: "}}