Comparing version 0.0.8 to 0.0.9
@@ -188,4 +188,4 @@ var nodeUrl = require('url'); | ||
UrlGrey.prototype.child = function(suffixes){ | ||
if (suffixes){ | ||
suffixes = _.toArray(arguments); | ||
suffixes = _.toArray(arguments); | ||
if (suffixes.length > 0){ | ||
return this.query(false).hash('').path(this.path(), suffixes); | ||
@@ -192,0 +192,0 @@ } else { |
@@ -5,3 +5,3 @@ { | ||
"keywords" : ["url", "uri"], | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"bugs": { | ||
@@ -8,0 +8,0 @@ "url": "https://github.com/cainus/urlgrey/issues" |
@@ -151,3 +151,3 @@ ![urlgrey](https://raw.github.com/cainus/urlgrey/master/urlgrey.png "urlgrey") | ||
###url.rawQuery(); | ||
This method is the same as url.rawQuery() but does not automatically url-encode | ||
This method is the same as url.query() but does not automatically url-encode | ||
any of the keys or values in an input object. | ||
@@ -154,0 +154,0 @@ |
@@ -190,2 +190,7 @@ var should = require('should'); | ||
}); | ||
it("returns a url with the given path suffix added even if it's 0", function(){ | ||
var url = "http://asdf.com/path?asdf=1234#frag"; | ||
urlgrey(url).child(0) | ||
.toString().should.equal('http://asdf.com/path/0'); | ||
}); | ||
it("returns the last item in the path if there is no input", function(){ | ||
@@ -192,0 +197,0 @@ var url = "http://asdf.com/path/kid?asdf=1234#frag"; |
49645
567