Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

urlgrey

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urlgrey - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

14

lib/index.js

@@ -108,3 +108,6 @@ var nodeUrl = require('url');

var pieces = this.path().split("/");
pieces.pop();
var popped = pieces.pop();
if (popped === ''){ // ignore trailing slash
pieces.pop();
}
return this.path(pieces.join("/"));

@@ -119,3 +122,10 @@ };

// if no suffix, return the child
return _.last(this.path().split("/"));
var pieces = this.path().split("/");
var last = _.last(pieces);
if ((pieces.length > 1) && (last === '')){
// ignore trailing slashes
pieces.pop();
last = _.last(pieces);
}
return last;
}

@@ -122,0 +132,0 @@ };

2

package.json

@@ -5,3 +5,3 @@ {

"keywords" : ["url", "uri"],
"version": "0.0.4",
"version": "0.0.5",
"bugs": {

@@ -8,0 +8,0 @@ "url": "https://github.com/cainus/urlgrey/issues"

@@ -118,2 +118,7 @@ var should = require('should');

});
it("ignores a trailing slash", function(){
var url = "http://asdf.com/path/kid/?asdf=1234#frag";
urlgrey(url).parent()
.toString().should.equal('http://asdf.com/path?asdf=1234#frag');
});
});

@@ -130,2 +135,6 @@ describe("#child", function(){

});
it("ignores a trailing slash", function(){
var url = "http://asdf.com/path/kid/?asdf=1234#frag";
urlgrey(url).child().should.equal('kid');
});
});

@@ -132,0 +141,0 @@ describe("#toString", function(){

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc