Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

isStructConstructorLike

Test if a value is struct constructor-like.

Usage

var isStructConstructorLike = require( '@stdlib/assert/is-struct-constructor-like' );

isStructConstructorLike( value )

Tests if a value is struct constructor-like.

var structFactory = require( '@stdlib/dstructs/struct' );

var schema = [
    {
        'name': 'value',
        'type': 'float64'
    }
];
var Struct = structFactory( schema );

var bool = isStructConstructorLike( Struct );
// returns true

Examples

var structFactory = require( '@stdlib/dstructs/struct' );
var isStructConstructorLike = require( '@stdlib/assert/is-struct-constructor-like' );

var schema = [
    {
        'name': 'value',
        'type': 'float64'
    }
];

var bool = isStructConstructorLike( structFactory( schema ) );
// returns true

bool = isStructConstructorLike( [ 1, 2, 3, 4 ] );
// returns false

bool = isStructConstructorLike( {} );
// returns false

bool = isStructConstructorLike( null );
// returns false

See Also