I played with generators in Nodejs v0.11.2 and I\'m wondering how I can check that argument to my function is generator function.
I found this way typeof f ===
typeof f ===
I checked how koa does it and they use this library: https://github.com/ljharb/is-generator-function.
You can use it like this
const isGeneratorFunction = require('is-generator-function'); if(isGeneratorFunction(f)) { ... }