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, 'dev' ) ) {
		opts.dev = options.dev;
		if ( !isBoolean( opts.dev ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'dev', opts.dev ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination object
@param {Options} options - function options
@param {PositiveInteger} [options.level] - dependency level
@param {boolean} [options.dev] - boolean indicating whether to return development dependencies
@returns {(Error|null)} error object or null

@example
var opts = {};
var options = {
    'dev': true
};

var err = validate( opts, options );
if ( err ) {
   throw err;
}