Socket
Socket
Sign inDemoInstall

url-parse

Package Overview
Dependencies
Maintainers
3
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-parse - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

5

index.js

@@ -154,3 +154,6 @@ 'use strict';

if ('query' === part) {
if ('string' === typeof value) value = (fn || qs.parse)(value);
if ('string' === typeof value && value.length) {
value = (fn || qs.parse)(value);
}
url[part] = value;

@@ -157,0 +160,0 @@ } else if ('port' === part) {

2

package.json
{
"name": "url-parse",
"version": "1.0.1",
"version": "1.0.2",
"description": "Parse URL in node using the URL module and in the browser using the DOM",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -282,2 +282,11 @@ describe('url-parse', function () {

it('removes querystring and hash', function () {
var data = parse('https://thisanurl.com/?swag=yolo#representing');
data.set('query', '');
data.set('hash', '');
assume(data.href).equals('https://thisanurl.com/');
});
it('only sets port when its not default', function () {

@@ -284,0 +293,0 @@ var data = parse('http://google.com/foo');

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