@aws-sdk/util-format-url 3.489.0 → 3.495.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist-cjs/index.js +57 -32
  2. package/package.json +5 -5
package/dist-cjs/index.js CHANGED
@@ -1,34 +1,59 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatUrl = void 0;
4
- const querystring_builder_1 = require("@smithy/querystring-builder");
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ formatUrl: () => formatUrl
24
+ });
25
+ module.exports = __toCommonJS(src_exports);
26
+ var import_querystring_builder = require("@smithy/querystring-builder");
5
27
  function formatUrl(request) {
6
- var _a, _b;
7
- const { port, query } = request;
8
- let { protocol, path, hostname } = request;
9
- if (protocol && protocol.slice(-1) !== ":") {
10
- protocol += ":";
11
- }
12
- if (port) {
13
- hostname += `:${port}`;
14
- }
15
- if (path && path.charAt(0) !== "/") {
16
- path = `/${path}`;
17
- }
18
- let queryString = query ? (0, querystring_builder_1.buildQueryString)(query) : "";
19
- if (queryString && queryString[0] !== "?") {
20
- queryString = `?${queryString}`;
21
- }
22
- let auth = "";
23
- if (request.username != null || request.password != null) {
24
- const username = (_a = request.username) !== null && _a !== void 0 ? _a : "";
25
- const password = (_b = request.password) !== null && _b !== void 0 ? _b : "";
26
- auth = `${username}:${password}@`;
27
- }
28
- let fragment = "";
29
- if (request.fragment) {
30
- fragment = `#${request.fragment}`;
31
- }
32
- return `${protocol}//${auth}${hostname}${path}${queryString}${fragment}`;
28
+ const { port, query } = request;
29
+ let { protocol, path, hostname } = request;
30
+ if (protocol && protocol.slice(-1) !== ":") {
31
+ protocol += ":";
32
+ }
33
+ if (port) {
34
+ hostname += `:${port}`;
35
+ }
36
+ if (path && path.charAt(0) !== "/") {
37
+ path = `/${path}`;
38
+ }
39
+ let queryString = query ? (0, import_querystring_builder.buildQueryString)(query) : "";
40
+ if (queryString && queryString[0] !== "?") {
41
+ queryString = `?${queryString}`;
42
+ }
43
+ let auth = "";
44
+ if (request.username != null || request.password != null) {
45
+ const username = request.username ?? "";
46
+ const password = request.password ?? "";
47
+ auth = `${username}:${password}@`;
48
+ }
49
+ let fragment = "";
50
+ if (request.fragment) {
51
+ fragment = `#${request.fragment}`;
52
+ }
53
+ return `${protocol}//${auth}${hostname}${path}${queryString}${fragment}`;
33
54
  }
34
- exports.formatUrl = formatUrl;
55
+ __name(formatUrl, "formatUrl");
56
+ // Annotate the CommonJS export names for ESM import in node:
57
+ 0 && (module.exports = {
58
+ formatUrl
59
+ });
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@aws-sdk/util-format-url",
3
- "version": "3.489.0",
3
+ "version": "3.495.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
- "build:cjs": "tsc -p tsconfig.cjs.json",
6
+ "build:cjs": "node ../../scripts/compilation/inline util-format-url",
7
7
  "build:es": "tsc -p tsconfig.es.json",
8
8
  "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
9
9
  "build:types": "tsc -p tsconfig.types.json",
@@ -20,9 +20,9 @@
20
20
  },
21
21
  "license": "Apache-2.0",
22
22
  "dependencies": {
23
- "@aws-sdk/types": "3.489.0",
24
- "@smithy/querystring-builder": "^2.0.16",
25
- "@smithy/types": "^2.8.0",
23
+ "@aws-sdk/types": "3.495.0",
24
+ "@smithy/querystring-builder": "^2.1.0",
25
+ "@smithy/types": "^2.9.0",
26
26
  "tslib": "^2.5.0"
27
27
  },
28
28
  "engines": {