Skip to content

Commit

Permalink
adding docs for uri.is('SLD')
Browse files Browse the repository at this point in the history
  • Loading branch information
rodneyrehm committed Feb 23, 2012
1 parent e32d875 commit a9806c1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs.html
Expand Up @@ -392,6 +392,7 @@ <h3 id="is">is()</h3>
<dl>
<dt><code>relative<code></dt><dd><code>true</code> if URL doesn't have a hostname</dd>
<dt><code>domain</code>, <code>name</code></dt><dd><code>true</code> if hostname is not an IP</dd>
<dt><code>sld</code></dt><dd><code>true</code> if hostname is a second level domain (i.e. "example.co.uk")</dd>
<dt><code>idn</code></dt><dd><code>true</code> if hostname contains non-alphanumeric characters and is not an IP</dd>
<dt><code>punycode</code></dt><dd><code>true</code> if hostname contains <code>xn--</code></dd>
<dt><code>ip</code></dt><dd><code>true</code> if hostname is IPv4 or IPv6</dd>
Expand All @@ -401,6 +402,7 @@ <h3 id="is">is()</h3>
<pre class="prettyprint lang-js">var uri = new URI("http://example.org/");
uri.is('relative') === false;
uri.is('name') === true;
uri.is('sld') === false;
uri.is('punycode') === false;
uri.is('IDN') === false; // case doesn't matter
uri.is('idn') === false; // case doesn't matter
Expand All @@ -409,6 +411,7 @@ <h3 id="is">is()</h3>
var uri = new URI("http://123.123.123.123/");
uri.is('relative') === false;
uri.is('name') === false;
uri.is('sld') === false;
uri.is('IP') === true;
uri.is('IPv4') === true;
uri.is('IPv6') === false;
Expand All @@ -421,7 +424,11 @@ <h3 id="is">is()</h3>
var uri = new URI("/hello/world.html");
uri.is('relative') === true;
uri.is('name') === false;
uri.is('IP') === false;</pre>
uri.is('IP') === false;

var uri = new URI("http://example.co.uk/");
uri.is('name') === true;
uri.is('sld') === true;</pre>


<h2 id="querystrings">Working with the query string</h2>
Expand Down

0 comments on commit a9806c1

Please sign in to comment.