Generator Functions
devmckeon opened this issue · 4 comments
I don't think your implementation of isFunction, considers generator functions. I think you should probably do a test for (typeof x==='function') first, instead of only looking at the to string output and looking for regular and async function types.
Unless of course, this is intentional... in which case I would recommend adding that intention to the documentation.
Regardless, you may want to consider adding an isGenerator test. =)
I think the issue is that sometimes functions can be returned as objects via typeof (like es5 class workarounds). Hence why Object.prototype.toString.call(function () {})
is used, which isn't the same as (function () {}).toString()
. Perhaps this behaviour is more reliable now (ecmascript has certainly refined itself over the years). Can you send me a fixture for generator functions, that I should test for.
I am currently preoccupied with tasks with revenue potential as my finances have depleted, so FOSS issues have been pushed to the backburner. If you want to speed them up on my queue, then consider making them a paid task by posting a bounty, as currently I earn nothing from my open-source work, so it cannot be a priority. Details for posting a bounty on this issue to incentivise its accomplishment sooner can be found here: https://bevry.me/bounties/
Otherwise a pull request will be the best means.
PR welcome