time-to-botec/squiggle/node_modules/@stdlib/assert/is-string
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
docs feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

isString

Test if a value is a string.

Usage

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

isString( value )

Tests if a value is a string.

var bool = isString( 'beep' );
// returns true

bool = isString( new String( 'beep' ) );
// returns true

isString.isPrimitive( value )

Tests if a value is a primitive string.

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

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

isString.isObject( value )

Tests if a value is a String object.

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

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

Examples

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

var bool = isString( 'beep' );
// returns true

bool = isString( new String( 'beep' ) );
// returns true

bool = isString( 5 );
// returns false

bool = isString( null );
// returns false

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

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

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

bool = isString( function foo() {} );
// returns false