We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function isGenerator(obj) { return 'function' == typeof obj.next && 'function' == typeof obj.throw; }
why not use toString.call(obj)==="[object Generator]" to replace that? I think this is a more definite judge solution than default way;
function isObject(val) { return Object == val.constructor; }
val.constrctor could be rewrited, I suggest that we can use toString.call(val)==="[object Object]" to get a more explicit check;
The text was updated successfully, but these errors were encountered:
When yielding {} in a generator, I get this message because the isObject function isn't more robust
{}
isObject
TypeError: You may only yield a function, promise, generator, array, or object, but the following object was passed: "[object Object]"
isObject, according to the most upvoted stackoverflow post should be:
return typeof yourVariable === 'object' && yourVariable !== null
Sorry, something went wrong.
Please label as Bug
No branches or pull requests
why not use toString.call(obj)==="[object Generator]" to replace that?
I think this is a more definite judge solution than default way;
val.constrctor could be rewrited, I suggest that we can use toString.call(val)==="[object Object]" to get a more explicit check;
The text was updated successfully, but these errors were encountered: