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, 'level' ) ) {
		opts.level = options.level;
		if ( !isPositiveInteger( opts.level ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'level', opts.level ) );
		}
	}
	if ( hasOwnProp( options, 'copy' ) ) {
		opts.copy = options.copy;
		if ( !isBoolean( opts.copy ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );
		}
	}
	if ( hasOwnProp( options, 'override' ) ) {
		opts.override = options.override;
		if (
			!isBoolean( opts.override ) &&
			!isFunction( opts.override )
		) {
			return new TypeError( format( 'invalid option. `%s` option must be either a boolean or a function. Option: `%s`.', 'override', opts.override ) );
		}
	}
	if ( hasOwnProp( options, 'extend' ) ) {
		opts.extend = options.extend;
		if ( !isBoolean( opts.extend ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'extend', opts.extend ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination object
@param {Options} options - options to validate
@param {number} [options.level] - merge level
@param {boolean} [options.copy] - boolean indicating whether to deep copy merged values
@param {(boolean|Function)} [options.override] - defines the merge strategy
@param {boolean} [options.extend] - boolean indicating whether new properties can be added to the target object
@returns {(Error|null)} error object or null