function validator( dtype ) {
	if ( dtype === 'generic' || dtype === '' ) {
		return validateGeneric;
	}
	if ( isRealFloatingDataType( dtype ) ) {
		return validateRealFloating;
	}
	if ( isUnsignedIntegerDataType( dtype ) ) {
		return validateUnsignedInteger;
	}
	if ( isSignedIntegerDataType( dtype ) ) {
		return validateSignedInteger;
	}
	if ( isBooleanDataType( dtype ) ) {
		return validateBoolean;
	}
	// Case: isComplexDataType( dtype ) === true
	return validateComplexFloating;
}
Returns a validation function for verifying whether a provided value can be safely assigned to an element in an array having a specified data type.

@private
@param {string} dtype - array data type
@returns {Function} validation function

@example
var fcn = validator( 'int32' );

var err = fcn( 3, 'int32' );
// returns null

err = fcn( 3.14, 'int32' );
// returns <TypeError>