Page MenuHomeSealhub

bin_node_modules_socket.io-client_lib_url.js.html
No OneTemporary

bin_node_modules_socket.io-client_lib_url.js.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>bin/node_modules/socket.io-client/lib/url.js - Prometheus Framework</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
<script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="../assets/css/logo.png" title="Prometheus Framework"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 0.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/Represents a
Replicaset Configuration.html">Represents a
Replicaset Configuration</a></li>
<li><a href="../classes/Represents a BatchWriteResult.html">Represents a BatchWriteResult</a></li>
<li><a href="../classes/Represents a Collection.html">Represents a Collection</a></li>
<li><a href="../classes/Represents a Cursor..html">Represents a Cursor.</a></li>
<li><a href="../classes/Represents a CursorStream..html">Represents a CursorStream.</a></li>
<li><a href="../classes/Represents a Db.html">Represents a Db</a></li>
<li><a href="../classes/Represents a GridFS File Stream..html">Represents a GridFS File Stream.</a></li>
<li><a href="../classes/.html"></a></li>
<li><a href="../classes/Represents a MongoClient.html">Represents a MongoClient</a></li>
<li><a href="../classes/Represents a Mongos connection with failover to backup proxies.html">Represents a Mongos connection with failover to backup proxies</a></li>
<li><a href="../classes/Represents a OrderedBulkOperation.html">Represents a OrderedBulkOperation</a></li>
<li><a href="../classes/Represents a Read Preference..html">Represents a Read Preference.</a></li>
<li><a href="../classes/Represents a Server connection..html">Represents a Server connection.</a></li>
<li><a href="../classes/Represents a UnorderedBulkOperation.html">Represents a UnorderedBulkOperation</a></li>
<li><a href="../classes/Represents the Admin methods of MongoDB..html">Represents the Admin methods of MongoDB.</a></li>
<li><a href="../classes/Represents the Grid..html">Represents the Grid.</a></li>
<li><a href="../classes/Represents the GridStore..html">Represents the GridStore.</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="../modules/association.html">association</a></li>
<li><a href="../modules/database-accessor.html">database-accessor</a></li>
<li><a href="../modules/field-type-manager.html">field-type-manager</a></li>
<li><a href="../modules/resource-type-manager.html">resource-type-manager</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: bin/node_modules/socket.io-client/lib/url.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
/**
* Module dependencies.
*/
var parseuri = require(&#x27;parseuri&#x27;);
var debug = require(&#x27;debug&#x27;)(&#x27;socket.io-client:url&#x27;);
/**
* Module exports.
*/
module.exports = url;
/**
* URL parser.
*
* @param {String} url
* @param {Object} An object meant to mimic window.location.
* Defaults to window.location.
* @api public
*/
function url(uri, loc){
var obj = uri;
// default to window.location
var loc = loc || global.location;
if (null == uri) uri = loc.protocol + &#x27;//&#x27; + loc.hostname;
// relative path support
if (&#x27;string&#x27; == typeof uri) {
if (&#x27;/&#x27; == uri.charAt(0)) {
if (&#x27;/&#x27; == uri.charAt(1)) {
uri = loc.protocol + uri;
} else {
uri = loc.hostname + uri;
}
}
if (!/^(https?|wss?):\/\//.test(uri)) {
debug(&#x27;protocol-less url %s&#x27;, uri);
if (&#x27;undefined&#x27; != typeof loc) {
uri = loc.protocol + &#x27;//&#x27; + uri;
} else {
uri = &#x27;https://&#x27; + uri;
}
}
// parse
debug(&#x27;parse %s&#x27;, uri);
obj = parseuri(uri);
}
// make sure we treat &#x60;localhost:80&#x60; and &#x60;localhost&#x60; equally
if (!obj.port) {
if (/^(http|ws)$/.test(obj.protocol)) {
obj.port = &#x27;80&#x27;;
}
else if (/^(http|ws)s$/.test(obj.protocol)) {
obj.port = &#x27;443&#x27;;
}
}
obj.path = obj.path || &#x27;/&#x27;;
// define unique id
obj.id = obj.protocol + &#x27;://&#x27; + obj.host + &#x27;:&#x27; + obj.port;
// define href
obj.href = obj.protocol + &#x27;://&#x27; + obj.host + (loc &amp;&amp; loc.port == obj.port ? &#x27;&#x27; : (&#x27;:&#x27; + obj.port));
return obj;
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>

File Metadata

Mime Type
text/html
Expires
Sat, Jun 7, 23:22 (15 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
734686
Default Alt Text
bin_node_modules_socket.io-client_lib_url.js.html (9 KB)

Event Timeline