function validate( opts, options ) {
	var name;
	var o;
	var f;
	var v;
	var i;
	if ( !isPlainObject( options ) ) {
		return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
	}
	for ( i = 0; i < SETTINGS_NAMES.length; i++ ) {
		name = SETTINGS_NAMES[ i ];
		if ( hasOwnProp( options, name ) ) {
			v = options[ name ];
			o = SETTINGS[ name ];
			f = VALIDATORS[ o.type ];
			if ( !f.assert( v ) ) {
				return new TypeError( f.msg( name, v ) );
			}
			opts[ name ] = v;
		}
	}
	return null;
}
Validates settings.

@private
@param {Object} opts - destination object
@param {Object} options - settings options
@returns {(Error|null)} error or null

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