Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

mini-url

Package Overview
Dependencies
3
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.7 to 2.1.8

14

dist/index.d.ts

@@ -9,9 +9,19 @@ import * as T from "./_types";

/**
* @description
* Creates a browser style URL object.
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/URL}
* See: https://developer.mozilla.org/en-US/docs/Web/API/URL
*
* @example
* parse("http//google.ca") // { protocol: "http", hostname: "google", ... }
*
* @param url The url string to parse.
* @param base The base part of the url to resolve from.
*/
export declare function parse(path: string, base?: string): T.URL;
export declare function parse(url: string, base?: string): T.URL;
/**
* @description
* Converts a URL like object into an href.
*
* @param parsed A parsed url object containing.
*/
export declare function stringify(parsed: T.URL): string;

19

dist/index.js

@@ -12,7 +12,14 @@ "use strict";

/**
* @description
* Creates a browser style URL object.
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/URL}
* See: https://developer.mozilla.org/en-US/docs/Web/API/URL
*
* @example
* parse("http//google.ca") // { protocol: "http", hostname: "google", ... }
*
* @param url The url string to parse.
* @param base The base part of the url to resolve from.
*/
function parse(path, base) {
var key = path + separator + base;
function parse(url, base) {
var key = url + separator + base;
// Try to return cached url.

@@ -24,3 +31,3 @@ var cached = cache[key];

// Parse url and cache result.
var parsed = base ? new url_1.URL(path, base) : new url_1.URL(path);
var parsed = base ? new url_1.URL(url, base) : new url_1.URL(url);
var result = { toString: toString };

@@ -41,3 +48,6 @@ // Make each part default to empty string for consistency.

/**
* @description
* Converts a URL like object into an href.
*
* @param parsed A parsed url object containing.
*/

@@ -58,2 +68,3 @@ function stringify(parsed) {

/**
* @description
* To string method for cloned urls.

@@ -60,0 +71,0 @@ */

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

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc