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, 'stopwords' ) ) {
		opts.stopwords = options.stopwords;
		if (
			!isStringArray( opts.stopwords ) &&
			!isEmptyArray( opts.stopwords )
		) {
			return new TypeError( format( 'invalid option. `%s` option must be an array of strings. Option: `%s`.', 'stopwords', opts.stopwords ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination object
@param {Options} options - options to validate
@param {StringArray} [options.stopwords] - array of custom stop words
@returns {(null|Error)} error object or null

@example
var opts = {};
var options = {
    'stopwords': [ 'of' ]
};
var err = validate( opts, options );
if ( err ) {
    throw err;
}