@aws-sdk/util-format-url
Advanced tools
Comparing version 3.178.0 to 3.183.0
@@ -6,2 +6,10 @@ # Change Log | ||
# [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03) | ||
**Note:** Version bump only for package @aws-sdk/util-format-url | ||
# [3.178.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.177.0...v3.178.0) (2022-09-23) | ||
@@ -8,0 +16,0 @@ |
import { buildQueryString } from "@aws-sdk/querystring-builder"; | ||
export function formatUrl(request) { | ||
var port = request.port, query = request.query; | ||
var protocol = request.protocol, path = request.path, hostname = request.hostname; | ||
const { port, query } = request; | ||
let { protocol, path, hostname } = request; | ||
if (protocol && protocol.slice(-1) !== ":") { | ||
@@ -9,12 +9,12 @@ protocol += ":"; | ||
if (port) { | ||
hostname += ":".concat(port); | ||
hostname += `:${port}`; | ||
} | ||
if (path && path.charAt(0) !== "/") { | ||
path = "/".concat(path); | ||
path = `/${path}`; | ||
} | ||
var queryString = query ? buildQueryString(query) : ""; | ||
let queryString = query ? buildQueryString(query) : ""; | ||
if (queryString && queryString[0] !== "?") { | ||
queryString = "?".concat(queryString); | ||
queryString = `?${queryString}`; | ||
} | ||
return "".concat(protocol, "//").concat(hostname).concat(path).concat(queryString); | ||
return `${protocol}//${hostname}${path}${queryString}`; | ||
} |
{ | ||
"name": "@aws-sdk/util-format-url", | ||
"version": "3.178.0", | ||
"version": "3.183.0", | ||
"scripts": { | ||
@@ -23,4 +23,4 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", | ||
"dependencies": { | ||
"@aws-sdk/querystring-builder": "3.178.0", | ||
"@aws-sdk/types": "3.178.0", | ||
"@aws-sdk/querystring-builder": "3.183.0", | ||
"@aws-sdk/types": "3.183.0", | ||
"tslib": "^2.3.1" | ||
@@ -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
49953
+ Added@aws-sdk/querystring-builder@3.183.0(transitive)
+ Added@aws-sdk/types@3.183.0(transitive)
+ Added@aws-sdk/util-uri-escape@3.183.0(transitive)
- Removed@aws-sdk/querystring-builder@3.178.0(transitive)
- Removed@aws-sdk/types@3.178.0(transitive)
- Removed@aws-sdk/util-uri-escape@3.170.0(transitive)
Updated@aws-sdk/types@3.183.0