Comparing version 0.1.0 to 0.1.1
18
index.js
@@ -67,2 +67,20 @@ 'use strict'; | ||
this._url.normalizePath(); | ||
}, | ||
// Origin is a read-only attribute: | ||
// http://url.spec.whatwg.org/#api | ||
get origin() { | ||
// "Let uri-scheme be the scheme component of the URI, | ||
// converted to lowercase." | ||
var scheme = this._url.protocol().toLowerCase(); | ||
var hostname = this._url.hostname().toLowerCase(); | ||
var port = ''; | ||
if (this._url._parts.port !== null && | ||
this._url._parts.port !== URI.defaultPorts[this._url.protocol()]) { | ||
port = ':' + this._url.port(); | ||
} | ||
return scheme + '://' + hostname + port; | ||
} | ||
@@ -69,0 +87,0 @@ }; |
{ | ||
"name": "dom-urls", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "DOM URLs for Node", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Node DOM URLs | ||
============= | ||
[![Build Status](https://travis-ci.org/passy/node-dom-urls.png)](https://travis-ci.org/passy/node-dom-urls) | ||
[![Code Climate](https://codeclimate.com/github/passy/node-dom-urls.png)](https://codeclimate.com/github/passy/node-dom-urls) | ||
[![Analytics](https://ga-beacon.appspot.com/UA-587894-18/node-dom-urls/readme)](https://github.com/igrigorik/ga-beacon) | ||
A partial implementation of the [W3C URL Spec Draft](https://dvcs.w3.org/hg/url/raw-file/tip/Overview.html) for Node building on top of [URIjs](http://medialize.github.io/URI.js/). | ||
@@ -5,0 +9,0 @@ |
4397
84
46