function validate( opts, options ) {
	var err;
	if ( !isPlainObject( options ) ) {
		return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
	}
	if ( hasOwnProp( options, 'schema' ) ) {
		if ( !isPlainObject( options.schema ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be an object. Option: `%s`.', 'schema', options.schema ) );
		}
		if ( !hasOwnProp( options.schema, 'root' ) ) {
			return new TypeError( format( 'invalid option. `%s` option must have %s `%s` property.', 'schema', 'a', 'root' ) );
		}
		err = validateSchema( options.schema );
		if ( err ) {
			return err;
		}
		opts.schema = options.schema;
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination object
@param {Options} options - function options
@param {Object} [options.schema] - schema for expected HTML sections
@returns {(Error|null)} null or an error object

@example
var opts = {};
var options = {
    'schema': {
        'root': {
            'required': [ 'usage', 'examples', 'links' ],
            'optional': [ 'intro', 'notes', 'c', 'references', 'related' ]
        }
    }
};
var err = validate( opts, options );
if ( err ) {
    throw err;
}