{"action":"opened","issue":{"url":"https://api.github.com/repos/losttype/metalsmith-register-helpers/issues/9","repository_url":"https://api.github.com/repos/losttype/metalsmith-register-helpers","labels_url":"https://api.github.com/repos/losttype/metalsmith-register-helpers/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/losttype/metalsmith-register-helpers/issues/9/comments","events_url":"https://api.github.com/repos/losttype/metalsmith-register-helpers/issues/9/events","html_url":"https://github.com/losttype/metalsmith-register-helpers/issues/9","id":265706637,"number":9,"title":"Use helper function name instead of file name","user":{"login":"nicolaisueper","id":6556377,"avatar_url":"https://avatars1.githubusercontent.com/u/6556377?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolaisueper","html_url":"https://github.com/nicolaisueper","followers_url":"https://api.github.com/users/nicolaisueper/followers","following_url":"https://api.github.com/users/nicolaisueper/following{/other_user}","gists_url":"https://api.github.com/users/nicolaisueper/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolaisueper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolaisueper/subscriptions","organizations_url":"https://api.github.com/users/nicolaisueper/orgs","repos_url":"https://api.github.com/users/nicolaisueper/repos","events_url":"https://api.github.com/users/nicolaisueper/events{/privacy}","received_events_url":"https://api.github.com/users/nicolaisueper/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-16T09:40:27Z","updated_at":"2017-10-16T09:40:27Z","closed_at":null,"author_association":"NONE","body":"Hey there,\r\n\r\nI encountered a problem where handlebars could not find my helper. I debugged into the code and stumbled across [this line](https://github.com/losttype/metalsmith-register-helpers/blob/master/index.js#L26).\r\n\r\nThe problem was, that my helper function was named in camelCase but the containing file was named in kebab-case.\r\n\r\nWouldn't it be better to do something like this: \r\n\r\n```switch (typeof helperContents) {\r\n  case 'function':\r\n    templateName = helperContents.name || file.split('.').shift();```\r\n\r\nSo the helper would be named like the file name only if the function isn't named.\r\n\r\nGreets\r\nNico"}}
{"actor":{"display_login":"nicolaisueper"}}