Sha256: 3ec3e8bbdcb9c8a98f30f2678c49338fb1edc8f5c88f4036bee0ae6244525a58

Contents?: true

Size: 690 Bytes

Versions: 88

Compression:

Stored size: 690 Bytes

Contents

/**
 * Parses an URI
 *
 * @author Steven Levithan <stevenlevithan.com> (MIT license)
 * @api private
 */

var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;

var parts = [
    'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host'
  , 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'
];

module.exports = function parseuri(str) {
  var m = re.exec(str || '')
    , uri = {}
    , i = 14;

  while (i--) {
    uri[parts[i]] = m[i] || '';
  }

  return uri;
};

Version data entries

88 entries across 88 versions & 2 rubygems

Version Path
flok-0.0.87 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.86 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.85 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.84 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.83 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.82 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.81 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.80 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.79 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.78 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.77 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.76 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.75 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.74 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.73 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.72 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.71 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.70 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.69 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js
flok-0.0.68 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/index.js