function validate( opts, options ) {
	if ( !isPlainObject( options ) ) {
		return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
	}
	if ( hasOwnProp( options, 'lpad' ) ) {
		opts.lpad = options.lpad;
		if ( !isString( opts.lpad ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'lpad', opts.lpad ) );
		}
	}
	if ( hasOwnProp( options, 'rpad' ) ) {
		opts.rpad = options.rpad;
		if ( !isString( opts.rpad ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'rpad', opts.rpad ) );
		}
	}
	if ( hasOwnProp( options, 'centerRight' ) ) {
		opts.centerRight = options.centerRight;
		if ( !isBoolean( opts.centerRight ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'centerRight', opts.centerRight ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination object
@param {Options} options - options to validate
@param {string} [options.lpad] - string used to left pad
@param {string} [options.rpad] - string used to right pad
@param {boolean} [options.centerRight] - boolean indicating whether to center right in the event of a tie
@returns {(null|Error)} error object or null

@example
var opts = {};
var options = {
    'lpad': 'a',
    'rpad': 'b'
};
var err = validate( opts, options );
if ( err ) {
    throw err;
}