Comparing version 1.0.13 to 1.0.14
@@ -6,2 +6,31 @@ # Change Log | ||
## [1.0.13](https://github.com/bluelovers/lazy-url/compare/lazy-url@1.0.12...lazy-url@1.0.13) (2021-08-11) | ||
### 🐛 Bug Fixes | ||
* avoid `origin` to be `null` https://github.com/nodejs/node/issues/39732#issuecomment-896624653 ([4e03764](https://github.com/bluelovers/lazy-url/commit/4e03764c00aa5535685694e7a1f0ff84c9f2023f)), closes [/github.com/nodejs/node/issues/39732#issuecomment-896624653](https://github.com//github.com/nodejs/node/issues/39732/issues/issuecomment-896624653) | ||
* origin should not be `null` https://github.com/nodejs/node/issues/39732#issuecomment-896624653 ([7780cbc](https://github.com/bluelovers/lazy-url/commit/7780cbc06691ec7242846c38d399cc96c3d1ef2a)), closes [/github.com/nodejs/node/issues/39732#issuecomment-896624653](https://github.com//github.com/nodejs/node/issues/39732/issues/issuecomment-896624653) | ||
* href is undefined ([5116455](https://github.com/bluelovers/lazy-url/commit/511645592f06a693f2c22c3ef8c91c3a92421a20)) | ||
* **protocol:** avoid bug of https://github.com/nodejs/node/issues/39732 ([7d03026](https://github.com/bluelovers/lazy-url/commit/7d03026e1cab6a052a09b2dccfcbd2fde8ce0001)) | ||
### ✨ Features | ||
* detect fake after set href ([72f15fc](https://github.com/bluelovers/lazy-url/commit/72f15fc191cb8e45924d00439ecfc719a71e7c46)) | ||
### 🚨 Tests | ||
* **url-parse:** update snapshot https://github.com/unshiftio/url-parse/commit/fb128af4f43fa17f351d50cf615c7598c751f50a ([8d9f2de](https://github.com/bluelovers/lazy-url/commit/8d9f2dedc2cd4fdc5ea56de2d6c9bf75fbd86d5c)) | ||
### ♻️ Chores | ||
* **deps:** update deps ([7121272](https://github.com/bluelovers/lazy-url/commit/7121272f8d583583863a843926b0fedea17061d2)) | ||
## [1.0.12](https://github.com/bluelovers/lazy-url/compare/lazy-url@1.0.11...lazy-url@1.0.12) (2021-07-19) | ||
@@ -8,0 +37,0 @@ |
@@ -12,5 +12,5 @@ "use strict"; | ||
const err_code_1 = (0, tslib_1.__importDefault)(require("err-code")); | ||
const indent_string_1 = (0, tslib_1.__importDefault)(require("indent-string")); | ||
const clean_stack_1 = (0, tslib_1.__importDefault)(require("clean-stack")); | ||
const replace_url_protocol_1 = require("replace-url-protocol"); | ||
const err_indent_1 = require("err-indent"); | ||
const err_stack_meta_1 = require("err-stack-meta"); | ||
exports.SYM_URL = Symbol('url'); | ||
@@ -391,14 +391,17 @@ exports.SYM_HIDDEN = Symbol('hidden'); | ||
} | ||
if (url && url instanceof LazyURL) { | ||
url = url.toRealString(); | ||
if (typeof url !== 'undefined' && url !== null) { | ||
if (url instanceof LazyURL) { | ||
url = url.toRealString(); | ||
} | ||
else if (url instanceof URL) { | ||
url = url.href; | ||
} | ||
else if (typeof url.href === 'string') { | ||
url = url.href; | ||
base !== null && base !== void 0 ? base : (base = url.baseURI); | ||
} | ||
} | ||
else if (url && url instanceof URL) { | ||
url = url.href; | ||
if (typeof url !== 'string') { | ||
throw _wrapError(new TypeError(`Argument '${(0, util_1.inspect)(url)}' is not assignable to url like.`), url, base); | ||
} | ||
else if (url != null && typeof url.href === 'string') { | ||
url = url.href; | ||
} | ||
else if (typeof url !== 'string') { | ||
throw _wrapError(new TypeError(`Argument '${url}' is not assignable to url like.`), url, base); | ||
} | ||
let _url; | ||
@@ -479,8 +482,8 @@ const _hidden_ = {}; | ||
exports._core = _core; | ||
function _wrapError(e, input, baseURL) { | ||
function _wrapError(e, input, baseURL, errInvalidUrl) { | ||
var _a; | ||
(0, ts_type_predicates_1.typePredicates)(e); | ||
let message = e.message; | ||
if (message === 'Invalid URL' || e.code === 'ERR_INVALID_URL') { | ||
message = _messageWithErrors(e, [ | ||
if (message === 'Invalid URL' || e.code === 'ERR_INVALID_URL' || errInvalidUrl) { | ||
message = (0, err_indent_1.messageWithSubErrors)(e, [ | ||
e, | ||
@@ -492,2 +495,10 @@ { | ||
]); | ||
let meta = (0, err_stack_meta_1.errStackMeta)(e); | ||
e.stack = (0, err_indent_1.errorsToMessageList)([ | ||
e, | ||
{ | ||
input, | ||
baseURL, | ||
}, | ||
], {}, e).concat([meta.stack]).join('\n'); | ||
} | ||
@@ -511,16 +522,2 @@ if (e.message !== message) { | ||
} | ||
function _messageWithErrors(e, errors) { | ||
let sub_message = errors | ||
.map((error) => { | ||
if (e === error) { | ||
return String(error); | ||
} | ||
else if (typeof (error === null || error === void 0 ? void 0 : error.stack) === 'string') { | ||
return (0, clean_stack_1.default)(error.stack); | ||
} | ||
return (0, util_1.inspect)(error); | ||
}) | ||
.join('\n'); | ||
return String(e.message) + '\n' + (0, indent_string_1.default)(sub_message, 4); | ||
} | ||
function isFakeProtocol(protocol) { | ||
@@ -527,0 +524,0 @@ return protocol === "fake+http:" /* protocol */; |
{ | ||
"name": "lazy-url", | ||
"version": "1.0.13", | ||
"version": "1.0.14", | ||
"description": "a more easy use URL", | ||
@@ -56,5 +56,4 @@ "keywords": [ | ||
"dependencies": { | ||
"clean-stack": ">=3 <4", | ||
"err-code": "^3.0.1", | ||
"indent-string": ">=4.0.0 <5", | ||
"err-indent": "^1.0.1", | ||
"replace-url-protocol": "^1.0.2", | ||
@@ -61,0 +60,0 @@ "symbol.inspect": "^1.0.1", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51334
7
626
+ Addederr-indent@^1.0.1
+ Added@types/node@22.9.0(transitive)
+ Addedarray-hyper-unique@2.1.6(transitive)
+ Addedcheck-iterable@1.2.0(transitive)
+ Addedcrlf-normalize@1.0.20(transitive)
+ Addederr-errors@1.0.14(transitive)
+ Addederr-indent@1.0.17(transitive)
+ Addederr-stack-meta@1.0.18(transitive)
+ Addederr-stack-reduce@1.0.16(transitive)
+ Addederror-stack2@2.0.7(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedstring-detect-indent@1.0.7(transitive)
+ Addedstring-split-keep2@1.0.12(transitive)
+ Addedts-toolbelt@9.6.0(transitive)
+ Addedts-type@3.0.1(transitive)
+ Addedtypedarray-dts@1.0.0(transitive)
+ Addedundici-types@6.19.8(transitive)
- Removedclean-stack@>=3 <4
- Removedindent-string@>=4.0.0 <5