{"action":"created","issue":{"url":"https://api.github.com/repos/callmecavs/stockpile.js/issues/1","repository_url":"https://api.github.com/repos/callmecavs/stockpile.js","labels_url":"https://api.github.com/repos/callmecavs/stockpile.js/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/callmecavs/stockpile.js/issues/1/comments","events_url":"https://api.github.com/repos/callmecavs/stockpile.js/issues/1/events","html_url":"https://github.com/callmecavs/stockpile.js/pull/1","id":135381662,"number":1,"title":"Added 'exists' API","user":{"login":"CVarisco","id":7335613,"avatar_url":"https://avatars.githubusercontent.com/u/7335613?v=3","gravatar_id":"","url":"https://api.github.com/users/CVarisco","html_url":"https://github.com/CVarisco","followers_url":"https://api.github.com/users/CVarisco/followers","following_url":"https://api.github.com/users/CVarisco/following{/other_user}","gists_url":"https://api.github.com/users/CVarisco/gists{/gist_id}","starred_url":"https://api.github.com/users/CVarisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CVarisco/subscriptions","organizations_url":"https://api.github.com/users/CVarisco/orgs","repos_url":"https://api.github.com/users/CVarisco/repos","events_url":"https://api.github.com/users/CVarisco/events{/privacy}","received_events_url":"https://api.github.com/users/CVarisco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-22T10:45:11Z","updated_at":"2016-02-22T15:50:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/callmecavs/stockpile.js/pulls/1","html_url":"https://github.com/callmecavs/stockpile.js/pull/1","diff_url":"https://github.com/callmecavs/stockpile.js/pull/1.diff","patch_url":"https://github.com/callmecavs/stockpile.js/pull/1.patch"},"body":"Hi! (sorry for my english)\r\nI have implemented this because I need to know if a collection exists without get any data.\r\nI have added a new API that check if a collection exists in the namespace.\r\nReturn true or false if exists.\r\nIf you think isn't good, please give me a suggestion. I'm junior and I want learn.\r\nThanks \r\n\r\nps: I have another API to add: \"isEmpty(name)\""},"comment":{"url":"https://api.github.com/repos/callmecavs/stockpile.js/issues/comments/187239838","html_url":"https://github.com/callmecavs/stockpile.js/pull/1#issuecomment-187239838","issue_url":"https://api.github.com/repos/callmecavs/stockpile.js/issues/1","id":187239838,"user":{"login":"callmecavs","id":2293641,"avatar_url":"https://avatars.githubusercontent.com/u/2293641?v=3","gravatar_id":"","url":"https://api.github.com/users/callmecavs","html_url":"https://github.com/callmecavs","followers_url":"https://api.github.com/users/callmecavs/followers","following_url":"https://api.github.com/users/callmecavs/following{/other_user}","gists_url":"https://api.github.com/users/callmecavs/gists{/gist_id}","starred_url":"https://api.github.com/users/callmecavs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callmecavs/subscriptions","organizations_url":"https://api.github.com/users/callmecavs/orgs","repos_url":"https://api.github.com/users/callmecavs/repos","events_url":"https://api.github.com/users/callmecavs/events{/privacy}","received_events_url":"https://api.github.com/users/callmecavs/received_events","type":"User","site_admin":false},"created_at":"2016-02-22T15:50:19Z","updated_at":"2016-02-22T15:50:19Z","body":"@CVarisco welcome to the open source community! even if you're new, it's great to have you contributing. wanting to learn is what it's all about. i like your idea for the method, and have two suggestions about how you've implemented it.\r\n\r\nfirst, because this code is all functions (no `prototype` involved), you dont need the `this` keyword to call the `get` method. it works correctly as you have it, but its more concise without it. your code could look as follows:\r\n\r\n```es6\r\nfunction exists(name) {\r\n  return !!get(name)\r\n}\r\n```\r\n\r\nsecond, and this is more a matter of my personal preference, but I dont think the `!!` syntax is very clear in indicating your intent to check if a key with the matching `name` exists. since the `get` method returns `null` if the key doesn't exist, let's instead check for that, like so:\r\n\r\n```es6\r\nfunction exists(name) {\r\n  return get(name) !== null\r\n}\r\n```\r\n\r\ni'm going to merge what you have, because you deserve the contribution, but change the method to match the above. thanks!"}}