Socket
Socket
Sign inDemoInstall

mini-url

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mini-url - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

11

index.js

@@ -30,9 +30,12 @@ 'use strict'

if (!result) {
// Cache result.
result = new URL(path, base)
// Parse url and cache result.
var parsed = new URL(path, base)
result = {}
// Make each part default to empty string for consistency.
for (var i = parts.length, part; i--;) {
for (var i = parts.length, part, data; i--;) {
part = parts[i]
result[part] = result[part] || ''
data = parsed[part]
if (data == null) data = ''
result[part] = data
}

@@ -39,0 +42,0 @@

{
"name": "mini-url",
"description": "Lightweight isomorphic url parser.",
"version": "1.4.0",
"version": "1.5.0",
"author": "Dylan Piercey <pierceydylan@gmail.com>",

@@ -6,0 +6,0 @@ "browser": {

@@ -44,3 +44,3 @@ 'use strict'

// Patch for browsers automatically adding default ports.
if (this.port) {
if (this.port !== '') {
var href = this.href

@@ -47,0 +47,0 @@ var hostname = this.hostname

@@ -17,3 +17,3 @@ 'use strict'

part = parts[i]
this[part] = parsed[part] || ''
this[part] = parsed[part]
}

@@ -20,0 +20,0 @@ }

@@ -81,3 +81,6 @@ 'use strict'

for (var key in expected) {
assert.equal(actual[key], decodeURIComponent(expected[key]), key + ' should match')
assert.equal(
actual[key] || '',
decodeURIComponent(expected[key])
)
}

@@ -84,0 +87,0 @@ })

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