console.warn('node_redis: WARNING: You passed "'+parsed.protocol.substring(0,parsed.protocol.length-1)+'" as protocol instead of the "redis" protocol!');
}
if(parsed.pathname&&parsed.pathname!=='/'){
options.db=parsed.pathname.substr(1);
}
if(parsed.hostname){
options.host=parsed.hostname;
}
if(parsed.port){
options.port=parsed.port;
}
if(parsed.search!==''){
varelem;
for(eleminparsed.query){
// If options are passed twice, only the parsed options will be used
if(eleminoptions){
if(options[elem]===parsed.query[elem]){
console.warn('node_redis: WARNING: You passed the '+elem+' option twice!');
}else{
thrownewRangeError('The '+elem+' option is added twice and does not match');
}
}
options[elem]=parsed.query[elem];
}
}
}elseif(parsed.hostname){
thrownewRangeError('The redis url must begin with slashes "//" or contain slashes after the redis protocol');