index.js
function getFromUrl(args) {
    if (!args || typeof args.url !== 'string') {
      return args;
    }

    try {
      var options = redisUrl.parse(args.url);
      // make a clone so we don't change input args
      return applyOptionsToArgs(args, options);
    } catch (e) {
      //url is unparsable so returning original
      return args;
    }

  }
function getFromUrl(args) {
    if (!args || typeof args.url !== 'string') {
      return args;
    }

    try {
      var options = redisUrl.parse(args.url);
      // make a clone so we don't change input args
      return applyOptionsToArgs(args, options);
    } catch (e) {
      //url is unparsable so returning original
      return args;
    }

  }
function getFromUrl ( args ) { if ( ! args || typeof args . url !== 'string' ) { return args ; } try { var options = redisUrl . parse ( args . url ) ; // make a clone so we don't change input args return applyOptionsToArgs ( args , options ) ; } catch ( e ) { //url is unparsable so returning original return args ; } }
Extracts options from an args.url
@param {Object} args
@param {String} args.url a string in format of redis://[:password@]host[:port][/db-number][?option=value]
@returns {Object} the input object args if it is falsy, does not contain url or url is not string, otherwise a new object with own properties of args
but with host, port, db, ttl and auth_pass properties overridden by those provided in args.url.
Extracts options from an args . url