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, 'size' ) ) {
		opts.size = options.size;
		if ( !isNonNegativeInteger( opts.size ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'size', opts.size ) );
		}
	}
	if ( hasOwnProp( options, 'probs' ) ) {
		opts.probs = options.probs;
		if ( !isUnityProbabilityArray( opts.probs ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be an array of probabilities that sum to one. Option: `%s`.', 'probs', opts.probs ) );
		}
	}
	if ( hasOwnProp( options, 'mutate' ) ) {
		opts.mutate = options.mutate;
		if ( !isBoolean( opts.mutate ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'mutate', opts.mutate ) );
		}
	}
	if ( hasOwnProp( options, 'replace' ) ) {
		opts.replace = options.replace;
		if ( !isBoolean( opts.replace ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'replace', opts.replace ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination for validated options
@param {Options} options - function options
@param {NonNegativeInteger} [options.size] - sample size
@param {ProbabilityArray} [options.probs] - element probabilities
@param {boolean} [options.replace] - boolean indicating whether to sample with replacement
@param {boolean} [options.mutate] - boolean indicating whether to mutate the `pool` when sampling without replacement
@returns {(null|Error)} null or an error

@example
var opts = {};
var options = {
    'size': 10,
    'replace': false,
    'mutate': true,
    'probs': [ 0.7, 0.3 ]
};
var err = validate( opts, options );
if ( err ) {
    throw err;
}