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

@private
@param {Object} opts - destination for function options
@param {Options} options - function options
@param {boolean} [options.decimal] - boolean indicating whether to always include a decimal point even for integer values
@param {boolean} [options.type] - boolean indicating whether to only specify type in created annotation
@param {PositiveInteger} [options.numel] - number of array elements to display in return annotation values before skipping elements via `...` notation
@param {PositiveInteger} [options.precision] - number of decimal digits for real-valued numbers
@returns {(Error|null)} error or null

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