function validate( opts, options ) {
	if ( !isPlainObject( options ) ) {
		return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
	}
	if ( hasOwnProp( options, 'dtype' ) ) {
		opts.dtype = options.dtype;
		if ( !isDType( opts.dtype ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a recognized/supported data type. Option: `%s`.', 'dtype', opts.dtype ) );
		}
	}
	if ( hasOwnProp( options, 'order' ) ) {
		opts.order = options.order;
		if ( !isOrder( opts.order ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a recognized/supported data type. Option: `%s`.', 'order', opts.order ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination object
@param {Object} options - options
@param {string} [options.dtype] - output array data type
@param {string} [options.order] - output array order
@returns {(Error|null)} null or an error object

@example
var opts = {};
var options = {
    'order': 'row-major'
};
var err = validate( opts, options );
if ( err ) {
    throw err;
}