function validate( opts, options ) {
	var err;
	var key;
	var val;
	var i;
	if ( !isObject( options ) ) {
		return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
	}
	for ( i = 0; i < KEYS.length; i++ ) {
		key = KEYS[ i ];
		if ( hasOwnProp( options, key ) ) {
			val = options[ key ];
			err = validators[ key ]( val );
			if ( err ) {
				return err;
			}
			opts[ key ] = val;
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination object
@param {Options} options - function options
@param {Function} [options.scale] - scale function
@param {string} [options.orientation] - axis orientation
@param {string} [options.label] - axis label
@param {(Array|null)} [options.ticks] - tick values
@param {(NonNegativeInteger|null)} [options.numTicks] - number of ticks
@param {(null|string|Function)} [options.tickFormat] - tick format
@param {NonNegativeInteger} [options.tickSize] - tick size
@param {NonNegativeInteger} [options.innerTickSize] - inner tick size
@param {NonNegativeInteger} [options.outerTickSize] - outer tick size
@param {NonNegativeInteger} [options.tickPadding] - tick padding
@returns {(Error|null)} error or null

@example
var opts = {};
var options = {
    'scale': function scale(){},
    'orientation': 'left',
    'tickSize': 10
};
var err = validate( opts, options );
if ( err ) {
    throw err;
}