function validate( opts, options ) {
	if ( !isObject( options ) ) {
		return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
	}
	if ( hasOwnProp( options, 'encoding' ) ) {
		opts.encoding = options.encoding;
		if ( !isArray( opts.encoding ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be an array. Option: `%s`.', 'encoding', opts.encoding ) );
		}
	}
	if ( hasOwnProp( options, 'method' ) ) {
		opts.method = options.method;
		if ( !isString( opts.method ) || !isMethod( opts.method ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'method', METHODS.join( '", "' ), opts.method ) );
		}
	}
	if ( hasOwnProp( options, 'missing' ) ) {
		opts.missing = options.missing;
		if ( !isString( opts.missing ) || !isMissing( opts.missing ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'missing', MISSING.join( '", "' ), opts.missing ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination for validated options
@param {Object} options - function options
@param {string} [options.method] - method determining how ties are treated
@param {string} [opts.missing] - determines where missing values go (`first`,`last`, or `remove`)
@param {Array} [opts.encoding] - array of values encoding missing values
@returns {(null|Error)} null or an error