Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "assert/is-generator-object/docs/types/index.d"

Index

Functions

Functions

Export assignment isGeneratorObject

  • isGeneratorObject(value: any): boolean
  • Tests if a value is a generator object.

    Parameters

    • value: any

      value to test

    Returns boolean

    boolean indicating whether value is a generator object

    Example

    function* generateID() {
        var idx = 0;
        while ( idx < idx+1 ) {
            yield idx;
            idx += 1;
        }
    }
    var bool = isGeneratorObject( generateID() );
    // returns true

    Example

    var bool = isGeneratorObject( {} );
    // returns false

    Example

    var bool = isGeneratorObject( null );
    // returns false