@aws-sdk/util-format-url
Advanced tools
Comparing version 3.342.0 to 3.347.0
@@ -6,2 +6,3 @@ "use strict"; | ||
function formatUrl(request) { | ||
var _a, _b; | ||
const { port, query } = request; | ||
@@ -22,4 +23,14 @@ let { protocol, path, hostname } = request; | ||
} | ||
return `${protocol}//${hostname}${path}${queryString}`; | ||
let auth = ""; | ||
if (request.username != null || request.password != null) { | ||
const username = (_a = request.username) !== null && _a !== void 0 ? _a : ""; | ||
const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; | ||
auth = `${username}:${password}@`; | ||
} | ||
let fragment = ""; | ||
if (request.fragment) { | ||
fragment = `#${request.fragment}`; | ||
} | ||
return `${protocol}//${auth}${hostname}${path}${queryString}${fragment}`; | ||
} | ||
exports.formatUrl = formatUrl; |
@@ -18,3 +18,13 @@ import { buildQueryString } from "@aws-sdk/querystring-builder"; | ||
} | ||
return `${protocol}//${hostname}${path}${queryString}`; | ||
let auth = ""; | ||
if (request.username != null || request.password != null) { | ||
const username = request.username ?? ""; | ||
const password = request.password ?? ""; | ||
auth = `${username}:${password}@`; | ||
} | ||
let fragment = ""; | ||
if (request.fragment) { | ||
fragment = `#${request.fragment}`; | ||
} | ||
return `${protocol}//${auth}${hostname}${path}${queryString}${fragment}`; | ||
} |
{ | ||
"name": "@aws-sdk/util-format-url", | ||
"version": "3.342.0", | ||
"version": "3.347.0", | ||
"scripts": { | ||
@@ -23,4 +23,4 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", | ||
"dependencies": { | ||
"@aws-sdk/querystring-builder": "3.342.0", | ||
"@aws-sdk/types": "3.342.0", | ||
"@aws-sdk/querystring-builder": "3.347.0", | ||
"@aws-sdk/types": "3.347.0", | ||
"tslib": "^2.5.0" | ||
@@ -27,0 +27,0 @@ }, |
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
15731
69
+ Added@aws-sdk/querystring-builder@3.347.0(transitive)
+ Added@aws-sdk/types@3.347.0(transitive)
- Removed@aws-sdk/querystring-builder@3.342.0(transitive)
- Removed@aws-sdk/types@3.342.0(transitive)
Updated@aws-sdk/types@3.347.0