function validate( opts ) {
	if ( !isObject( opts ) ) {
		return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );
	}
	if ( hasOwnProp( opts, 'x' ) ) {
		if ( !isArray( opts.x ) && !isTypedArray( opts.x ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be an array or typed array. Option: `%s`.', 'x', opts.x ) );
		}
	}
	if ( hasOwnProp( opts, 'xValue' ) ) {
		if ( !isFunction( opts.xValue ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a function. Option: `%s`.', 'xValue', opts.xValue ) );
		}
	}
	if ( hasOwnProp( opts, 'y' ) ) {
		if ( !isArray( opts.y ) && !isTypedArray( opts.y ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be an array or typed array. Option: `%s`.', 'y', opts.y ) );
		}
	}
	if ( hasOwnProp( opts, 'yValue' ) ) {
		if ( !isFunction( opts.yValue ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a function. Option: `%s`.', 'yValue', opts.yValue ) );
		}
	}
	if ( hasOwnProp( opts, 'leafDigits' ) ) {
		if ( !isPositiveInteger( opts.leafDigits ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'leafDigits', opts.leafDigits ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Options} opts - function options
@param {(Array|TypedArray)} [opts.x] - chart data
@param {(Array|TypedArray)} [opts.y] - chart data
@param {Function} [opts.xValue] - x-value accessor
@param {Function} [opts.yValue] - y-value accessor
@param {PositiveInteger} leafDigits - number of digits to display as leafs
@returns {(Error|null)} error or null

@example
var opts = {
    'x': [ 23, 11, 137, 58 ],
    'y': [ 21, 11, 39, 80 ]
};
var err = validate( opts );
if ( err ) {
    throw err;
}