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

lazy-url

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lazy-url - npm Package Compare versions

Comparing version 1.0.15 to 1.0.16

16

CHANGELOG.md

@@ -6,2 +6,18 @@ # Change Log

## [1.0.15](https://github.com/bluelovers/lazy-url/compare/lazy-url@1.0.14...lazy-url@1.0.15) (2021-08-11)
### ✨ Features
* support auth ([8e537fe](https://github.com/bluelovers/lazy-url/commit/8e537fe258660844f5b22d2abd5306ef91feb0ea))
### 🚨 Tests
* update test ([e530690](https://github.com/bluelovers/lazy-url/commit/e53069062dfde7e9b34fc2326370c36887e336e5))
## [1.0.14](https://github.com/bluelovers/lazy-url/compare/lazy-url@1.0.13...lazy-url@1.0.14) (2021-08-11)

@@ -8,0 +24,0 @@

8

lib/index.d.ts
/**
* Created by user on 2019/6/6.
*/
import { StringifyQuery, URLPart } from 'url-parse';
export declare type IURLLike = string | URL | IURLObjectLike;

@@ -29,3 +30,6 @@ export declare const SYM_URL: unique symbol;

*/
toRealString(ignoreInvalid?: boolean): string;
toRealString(options?: {
ignoreInvalid?: boolean;
stringify?: StringifyQuery;
}): string;
toString(): string;

@@ -81,2 +85,4 @@ get hostname(): string;

createURLSearchParams(init?: string[][] | Record<string, string> | string | URLSearchParams | URL): URLSearchParams;
set<K extends Extract<URLPart, keyof LazyURL>>(part: K, value: LazyURL[K]): void;
get<K extends Extract<URLPart, keyof LazyURL>>(part: K): LazyURL[K];
}

@@ -83,0 +89,0 @@ export declare type IEntries = (["hash" | "host" | "hostname" | "href" | "password" | "pathname" | "port" | "protocol" | "search" | "username", string] | ["searchParams", URLSearchParams])[];

12

lib/index.js

@@ -84,3 +84,3 @@ "use strict";

*/
toRealString(ignoreInvalid) {
toRealString(options) {
let ks = this.fakeEntries();

@@ -96,3 +96,3 @@ if (ks.length) {

if (u.host === '') {
if (ignoreInvalid) {
if (options === null || options === void 0 ? void 0 : options.ignoreInvalid) {
u.set('username', '');

@@ -108,3 +108,3 @@ u.set('password', '');

}
let s = u.toString();
let s = u.toString(options === null || options === void 0 ? void 0 : options.stringify);
if (u.protocol === '' && u.host === '') {

@@ -373,2 +373,8 @@ s = s.replace(/^\/\//, '');

}
set(part, value) {
this[part] = value;
}
get(part) {
return this[part];
}
}

@@ -375,0 +381,0 @@ exports.LazyURL = LazyURL;

{
"name": "lazy-url",
"version": "1.0.15",
"version": "1.0.16",
"description": "a more easy use URL",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

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