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, 'alpha' ) ) {
		opts.alpha = options.alpha;
		if ( !isNumber( opts.alpha ) || isnan( opts.alpha ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a number. Option: `%s`.', 'alpha', opts.alpha ) );
		}
		if ( opts.alpha < 0.0 || opts.alpha > 1.0 ) {
			return new RangeError( format( 'invalid option. `%s` option must be a number on the interval: [0, 1]. Option: `%f`.', 'alpha', opts.alpha ) );
		}
	}
	if ( hasOwnProp( options, 'alternative' ) ) {
		opts.alternative = options.alternative;
		if ( !isString( opts.alternative ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'alternative', opts.alternative ) );
		}
		if ( !isAlternativeValue( opts.alternative ) ) {
			return new Error( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'alternative', ALTERNATIVE_VALUES.join( '", "' ), opts.alternative ) );
		}
	}
	if ( hasOwnProp( options, 'correction' ) ) {
		opts.correction = options.correction;
		if ( !isBoolean( opts.correction ) || isnan( opts.correction ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'correction', opts.alpha ) );
		}
	}
	if ( hasOwnProp( options, 'exact' ) ) {
		opts.exact = options.exact;
		if (
			!isBoolean( opts.exact ) ||
			isnan( opts.exact )
		) {
			return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'exact', opts.alpha ) );
		}
	}
	if ( hasOwnProp( options, 'mu' ) ) {
		opts.mu = options.mu;
		if ( !isNumber( opts.mu ) || isnan( opts.mu ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a number. Option: `%s`.', 'mu', opts.mu ) );
		}
	}
	if ( hasOwnProp( options, 'zeroMethod' ) ) {
		opts.zeroMethod = options.zeroMethod;
		if ( !isString( opts.zeroMethod ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'zeroMethod', opts.alternative ) );
		}
		if ( !isZeroMethod( opts.zeroMethod ) ) {
			return new Error( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'zeroMethod', ZERO_METHOD_VALUES.join( '", "' ), opts.zeroMethod ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination for validated options
@param {Options} options - function options
@param {number} [options.alpha] - significance level
@param {string} [options.alternative] - alternative hypothesis (`two-sided`, `less` or `greater`)
@param {boolean} [options.exact] - whether to force using the exact distribution instead of a normal approximation when there are more than fifty data points
@param {boolean} [options.correction] - continuity correction adjusting the Wilcoxon rank statistic by 0.5 towards the mean
@param {string} [options.zeroMethod] - method governing how zero-differences are handled (`pratt`, `wilcox` or `zsplit`)
@param {number} [options.mu] - mean under H0
@returns {(null|Error)} null or an error