Test if a value is
generator
object-like.
var isGeneratorObjectLike = require( '@stdlib/assert/is-generator-object-like' );
Tests if a value
is generator
object-like.
var obj = {
'next': function noop() {},
'return': function noop() {},
'throw': function noop() {}
};
var bool = isGeneratorObjectLike( obj );
// returns true
bool = isGeneratorObjectLike( {} );
// returns false
var noop = require( '@stdlib/utils/noop' );
var isGeneratorObjectLike = require( '@stdlib/assert/is-generator-object-like' );
var obj = {
'next': noop,
'return': noop,
'throw': noop
};
var bool = isGeneratorObjectLike( obj );
// returns true
bool = isGeneratorObjectLike( {} );
// returns false
bool = isGeneratorObjectLike( [] );
// returns false
bool = isGeneratorObjectLike( null );
// returns false
@stdlib/assert/has-generator-support
: detect native generator function support.@stdlib/assert/is-generator-object
: test if a value is a generator object.