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.14 to 1.0.15

11

CHANGELOG.md

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

## [1.0.14](https://github.com/bluelovers/lazy-url/compare/lazy-url@1.0.13...lazy-url@1.0.14) (2021-08-11)
### 📦 Code Refactoring
* update error ([1faa913](https://github.com/bluelovers/lazy-url/commit/1faa91392e2fc910990f89f65030b87d9ee2fce1))
## [1.0.13](https://github.com/bluelovers/lazy-url/compare/lazy-url@1.0.12...lazy-url@1.0.13) (2021-08-11)

@@ -8,0 +19,0 @@

4

lib/index.d.ts

@@ -29,3 +29,3 @@ /**

*/
toRealString(): string;
toRealString(ignoreInvalid?: boolean): string;
toString(): string;

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

set protocol(value: string);
get auth(): string;
set auth(value: string);
/**

@@ -43,0 +45,0 @@ * @alias protocol

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

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

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

if (u.host === '') {
if (u.username !== '' || u.password !== '' || u.port !== '' || u.protocol !== '') {
if (ignoreInvalid) {
u.set('username', '');
u.set('password', '');
u.set('port', '');
u.set('protocol', '');
}
else if (u.username !== '' || u.password !== '' || u.port !== '' || u.protocol !== '') {
//throw new TypeError(`Invalid URL ${u}`)

@@ -234,2 +240,16 @@ throw _wrapError(new TypeError(`Invalid URL`), u);

}
get auth() {
var _a, _b;
if ((_a = this.username) === null || _a === void 0 ? void 0 : _a.length) {
return `${this.username}:${(_b = this.password) !== null && _b !== void 0 ? _b : ''}`;
}
return '';
}
set auth(value) {
this.username = '';
this.password = '';
let ls = value.split(':');
this.username = ls.shift();
this.password = ls.join(':');
}
/*

@@ -236,0 +256,0 @@ get search()

{
"name": "lazy-url",
"version": "1.0.14",
"version": "1.0.15",
"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