'use strict';

// MODULES //

var isString = require( '@stlib/utils/is-string' )[ 'primitive' ];


// BINARY STRING //

/**
* FUNCTION: isBinaryString( value )
*	Tests if a value is a binary string.
*
* @param {*} value - value to test
* @returns {Boolean} boolean indicating if an input value is a binary string
*/
function isBinaryString( str ) {
	var len;
	var ch;
	var i;
	if ( !isString( str ) ) {
		return false;
	}
	len = str.length;
	if ( !len ) {
		return false;
	}
	for ( i = 0; i < len; i++ ) {
		ch = str[ i ];
		if ( ch !== '1' && ch !== '0' ) {
			return false;
		}
	}
	return true;
} // end FUNCTION isBinaryString()


// EXPORTS //

module.exports = isBinaryString;

'use strict';

// MODULES //

var isString = require( '@stdlib/utils/is-string' )[ 'primitive' ];


// BINARY STRING //

/**
* FUNCTION: isBinaryString( value )
*	Tests if a value is a binary string.
*
* @param {*} value - value to test
* @returns {Boolean} boolean indicating if an input value is a binary string
*/
function isBinaryString( str ) {
	var len;
	var ch;
	var i;
	if ( !isString( str ) ) {
		return false;
	}
	len = str.length;
	if ( !len ) {
		return false;
	}
	for ( i = 0; i < len; i++ ) {
		ch = str[ i ];
		if ( ch !== '1' && ch !== '0' ) {
			return false;
		}
	}
	return true;
} // end FUNCTION isBinaryString()


// EXPORTS //

module.exports = isBinaryString;

Fix typo in require statement of is-binary-string
Fix typo in require statement of is-binary-string
