@nuskin/ns-common-lib
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -0,1 +1,13 @@ | ||
## [1.4.2](https://code.tls.nuskin.io/ns-am/utility/npm/ns-common-lib/compare/v1.4.1...v1.4.2) (2022-03-08) | ||
### Chore | ||
* updated testing for fromJsonString ([abfaf07](https://code.tls.nuskin.io/ns-am/utility/npm/ns-common-lib/commit/abfaf070c11c97dafedc50b43667045b919bfada)) | ||
### Fix | ||
* (urls) handle incomplete/missing protocols for getFullUrl (#CX12-4845) ([5fd378d](https://code.tls.nuskin.io/ns-am/utility/npm/ns-common-lib/commit/5fd378de0b82c7f85ded978d9469be01713c473d)), closes [#CX12-4845](https://code.tls.nuskin.io/ns-am/utility/npm/ns-common-lib/issues/CX12-4845) | ||
* fixed logic causing failure in sonarqube failure (#CX12-4845) ([a3a4478](https://code.tls.nuskin.io/ns-am/utility/npm/ns-common-lib/commit/a3a447866bfa3d4dc6ca0ec0a46b024b81510ffe)), closes [#CX12-4845](https://code.tls.nuskin.io/ns-am/utility/npm/ns-common-lib/issues/CX12-4845) | ||
## [1.4.1](https://code.tls.nuskin.io/ns-am/utility/npm/ns-common-lib/compare/v1.4.0...v1.4.1) (2021-05-18) | ||
@@ -2,0 +14,0 @@ |
{ | ||
"name": "@nuskin/ns-common-lib", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "This project contains shared common models and code between the backend and frontend.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -11,6 +11,18 @@ "use strict"; | ||
if (url) { | ||
if(siteUrl && siteUrl.endsWith("/")) { | ||
siteUrl = siteUrl || ""; | ||
if(siteUrl.endsWith("/")) { | ||
siteUrl = siteUrl.slice(0, -1); | ||
} | ||
return url.startsWith("/") ? `${siteUrl || ""}${url}` : url; | ||
// likely a content path or relative url | ||
if (url.startsWith("/")) { | ||
return `${siteUrl}${url}`; | ||
} | ||
// fully-qualified url | ||
else if (url.match(/^.{3,5}:\/\//)) { | ||
return url; | ||
} | ||
// incomplete url, needs protocol | ||
return `https://${url}`; | ||
} | ||
@@ -17,0 +29,0 @@ return ""; |
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
14966
344