{"action":"created","issue":{"url":"https://api.github.com/repos/sinonjs/sinon/issues/1919","repository_url":"https://api.github.com/repos/sinonjs/sinon","labels_url":"https://api.github.com/repos/sinonjs/sinon/issues/1919/labels{/name}","comments_url":"https://api.github.com/repos/sinonjs/sinon/issues/1919/comments","events_url":"https://api.github.com/repos/sinonjs/sinon/issues/1919/events","html_url":"https://github.com/sinonjs/sinon/issues/1919","id":367911854,"node_id":"MDU6SXNzdWUzNjc5MTE4NTQ=","number":1919,"title":"Remove duplication: create async methods","user":{"login":"mroderick","id":20321,"node_id":"MDQ6VXNlcjIwMzIx","avatar_url":"https://avatars2.githubusercontent.com/u/20321?v=4","gravatar_id":"","url":"https://api.github.com/users/mroderick","html_url":"https://github.com/mroderick","followers_url":"https://api.github.com/users/mroderick/followers","following_url":"https://api.github.com/users/mroderick/following{/other_user}","gists_url":"https://api.github.com/users/mroderick/gists{/gist_id}","starred_url":"https://api.github.com/users/mroderick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mroderick/subscriptions","organizations_url":"https://api.github.com/users/mroderick/orgs","repos_url":"https://api.github.com/users/mroderick/repos","events_url":"https://api.github.com/users/mroderick/events{/privacy}","received_events_url":"https://api.github.com/users/mroderick/received_events","type":"User","site_admin":false},"labels":[{"id":249301120,"node_id":"MDU6TGFiZWwyNDkzMDExMjA=","url":"https://api.github.com/repos/sinonjs/sinon/labels/Help%20wanted","name":"Help wanted","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-08T18:53:13Z","updated_at":"2018-10-28T01:08:59Z","closed_at":null,"author_association":"MEMBER","body":"While working on the codebase tonight, I discovered some unnecessary duplication:\r\n\r\nhttps://github.com/sinonjs/sinon/blob/master/lib/sinon/default-behaviors.js#L266-L272\r\n\r\n```js\r\n// create asynchronous versions of callsArg* and yields* methods\r\nforEach(Object.keys(module.exports), function (method) {\r\n    // need to avoid creating anotherasync versions of the newly added async methods\r\n    if (method.match(/^(callsArg|yields)/) && !method.match(/Async/)) {\r\n        module.exports[method + \"Async\"] = createAsyncVersion(method);\r\n    }\r\n});\r\n```\r\n\r\nand\r\n\r\nhttps://github.com/sinonjs/sinon/blob/master/lib/sinon/behavior.js#L216-L222\r\n\r\n```js\r\n// create asynchronous versions of callsArg* and yields* methods\r\nforEach(Object.keys(proto), function (method) {\r\n    // need to avoid creating anotherasync versions of the newly added async methods\r\n    if (method.match(/^(callsArg|yields)/) && !method.match(/Async/)) {\r\n        proto[method + \"Async\"] = createAsyncVersion(method);\r\n    }\r\n});\r\n```\r\n\r\nWe should refactor the code to only have one copy of this, and re-use it."},"comment":{"url":"https://api.github.com/repos/sinonjs/sinon/issues/comments/433667984","html_url":"https://github.com/sinonjs/sinon/issues/1919#issuecomment-433667984","issue_url":"https://api.github.com/repos/sinonjs/sinon/issues/1919","id":433667984,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzY2Nzk4NA==","user":{"login":"LEQADA","id":9251453,"node_id":"MDQ6VXNlcjkyNTE0NTM=","avatar_url":"https://avatars2.githubusercontent.com/u/9251453?v=4","gravatar_id":"","url":"https://api.github.com/users/LEQADA","html_url":"https://github.com/LEQADA","followers_url":"https://api.github.com/users/LEQADA/followers","following_url":"https://api.github.com/users/LEQADA/following{/other_user}","gists_url":"https://api.github.com/users/LEQADA/gists{/gist_id}","starred_url":"https://api.github.com/users/LEQADA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LEQADA/subscriptions","organizations_url":"https://api.github.com/users/LEQADA/orgs","repos_url":"https://api.github.com/users/LEQADA/repos","events_url":"https://api.github.com/users/LEQADA/events{/privacy}","received_events_url":"https://api.github.com/users/LEQADA/received_events","type":"User","site_admin":false},"created_at":"2018-10-28T01:08:59Z","updated_at":"2018-10-28T01:08:59Z","author_association":"NONE","body":"@morgsmccauley sorry for a long inactivity. I already started to work on the issue but didn't have time to write tests. I plan to finish it next week if it's not urgent. If it's urgent then sure take it over. \r\nOtherwise I'd ask to give me some more days. :slightly_smiling_face: "}}
{"actor":{"display_login":"LEQADA"}}