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, 'persist' ) ) {
		opts.persist = options.persist;
		if ( !isBoolean( opts.persist ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'persist', opts.persist ) );
		}
	}
	if ( hasOwnProp( options, 'kind' ) ) {
		opts.kind = options.kind;
		if ( !isKind( opts.kind ) && opts.kind !== '' ) {
			return new TypeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'kind', KINDS.join( '", "' ), opts.kind ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination object
@param {Options} options - function options
@param {boolean} [options.persist] - boolean indicating whether to continue persisting an index object after first usage
@param {string} [options.kind] - specifies whether a provided ndarray is a specialized kind of integer input ndarray
@returns {(Error|null)} null or an error object

@example
var opts = {};
var options = {
    'persist': false
};
var err = validate( opts, options );
if ( err ) {
    throw err;
}