@aws-sdk/util-format-url
Advanced tools
Comparing version 3.489.0 to 3.495.0
@@ -1,34 +0,59 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatUrl = void 0; | ||
const querystring_builder_1 = require("@smithy/querystring-builder"); | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
formatUrl: () => formatUrl | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
var import_querystring_builder = require("@smithy/querystring-builder"); | ||
function formatUrl(request) { | ||
var _a, _b; | ||
const { port, query } = request; | ||
let { protocol, path, hostname } = request; | ||
if (protocol && protocol.slice(-1) !== ":") { | ||
protocol += ":"; | ||
} | ||
if (port) { | ||
hostname += `:${port}`; | ||
} | ||
if (path && path.charAt(0) !== "/") { | ||
path = `/${path}`; | ||
} | ||
let queryString = query ? (0, querystring_builder_1.buildQueryString)(query) : ""; | ||
if (queryString && queryString[0] !== "?") { | ||
queryString = `?${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}`; | ||
const { port, query } = request; | ||
let { protocol, path, hostname } = request; | ||
if (protocol && protocol.slice(-1) !== ":") { | ||
protocol += ":"; | ||
} | ||
if (port) { | ||
hostname += `:${port}`; | ||
} | ||
if (path && path.charAt(0) !== "/") { | ||
path = `/${path}`; | ||
} | ||
let queryString = query ? (0, import_querystring_builder.buildQueryString)(query) : ""; | ||
if (queryString && queryString[0] !== "?") { | ||
queryString = `?${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}`; | ||
} | ||
exports.formatUrl = formatUrl; | ||
__name(formatUrl, "formatUrl"); | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
formatUrl | ||
}); |
{ | ||
"name": "@aws-sdk/util-format-url", | ||
"version": "3.489.0", | ||
"version": "3.495.0", | ||
"scripts": { | ||
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", | ||
"build:cjs": "tsc -p tsconfig.cjs.json", | ||
"build:cjs": "node ../../scripts/compilation/inline util-format-url", | ||
"build:es": "tsc -p tsconfig.es.json", | ||
@@ -23,5 +23,5 @@ "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", | ||
"dependencies": { | ||
"@aws-sdk/types": "3.489.0", | ||
"@smithy/querystring-builder": "^2.0.16", | ||
"@smithy/types": "^2.8.0", | ||
"@aws-sdk/types": "3.495.0", | ||
"@smithy/querystring-builder": "^2.1.0", | ||
"@smithy/types": "^2.9.0", | ||
"tslib": "^2.5.0" | ||
@@ -28,0 +28,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
16570
93
+ Added@aws-sdk/types@3.495.0(transitive)
- Removed@aws-sdk/types@3.489.0(transitive)
Updated@aws-sdk/types@3.495.0
Updated@smithy/types@^2.9.0