isEmptyString

Test if a value is an empty string.

Usage

var isEmptyString = require( '@stdlib/assert/is-empty-string' );

isEmptyString( value )

Tests if a value is an empty string.

var bool = isEmptyString( '' );
// returns true

bool = isEmptyString( new String( '' ) );
// returns true

isEmptyString.isPrimitive( value )

Tests if a value is an empty primitive string.

var bool = isEmptyString.isPrimitive( '' );
// returns true

bool = isEmptyString.isPrimitive( new String( '' ) );
// returns false

isEmptyString.isObject( value )

Tests if a value is an empty String object.

var bool = isEmptyString.isObject( '' );
// returns false

bool = isEmptyString.isObject( new String( '' ) );
// returns true

Examples

var isEmptyString = require( '@stdlib/assert/is-empty-string' );

var bool = isEmptyString( '' );
// returns true

bool = isEmptyString( new String( '' ) );
// returns true

bool = isEmptyString( 'beep' );
// returns false

bool = isEmptyString( 0 );
// returns false

bool = isEmptyString( null );
// returns false

bool = isEmptyString( void 0 );
// returns false

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

bool = isEmptyString( [] );
// returns false

bool = isEmptyString( function empty() {} );
// returns false
Did you find this page helpful?