@aws-sdk/util-format-url 3.901.0 → 3.910.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.
- package/dist-cjs/index.js +30 -58
- package/package.json +4 -4
package/dist-cjs/index.js
CHANGED
|
@@ -1,62 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var querystringBuilder = require('@smithy/querystring-builder');
|
|
20
4
|
|
|
21
|
-
// src/index.ts
|
|
22
|
-
var index_exports = {};
|
|
23
|
-
__export(index_exports, {
|
|
24
|
-
formatUrl: () => formatUrl
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(index_exports);
|
|
27
|
-
var import_querystring_builder = require("@smithy/querystring-builder");
|
|
28
5
|
function formatUrl(request) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
6
|
+
const { port, query } = request;
|
|
7
|
+
let { protocol, path, hostname } = request;
|
|
8
|
+
if (protocol && protocol.slice(-1) !== ":") {
|
|
9
|
+
protocol += ":";
|
|
10
|
+
}
|
|
11
|
+
if (port) {
|
|
12
|
+
hostname += `:${port}`;
|
|
13
|
+
}
|
|
14
|
+
if (path && path.charAt(0) !== "/") {
|
|
15
|
+
path = `/${path}`;
|
|
16
|
+
}
|
|
17
|
+
let queryString = query ? querystringBuilder.buildQueryString(query) : "";
|
|
18
|
+
if (queryString && queryString[0] !== "?") {
|
|
19
|
+
queryString = `?${queryString}`;
|
|
20
|
+
}
|
|
21
|
+
let auth = "";
|
|
22
|
+
if (request.username != null || request.password != null) {
|
|
23
|
+
const username = request.username ?? "";
|
|
24
|
+
const password = request.password ?? "";
|
|
25
|
+
auth = `${username}:${password}@`;
|
|
26
|
+
}
|
|
27
|
+
let fragment = "";
|
|
28
|
+
if (request.fragment) {
|
|
29
|
+
fragment = `#${request.fragment}`;
|
|
30
|
+
}
|
|
31
|
+
return `${protocol}//${auth}${hostname}${path}${queryString}${fragment}`;
|
|
55
32
|
}
|
|
56
|
-
__name(formatUrl, "formatUrl");
|
|
57
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
-
|
|
59
|
-
0 && (module.exports = {
|
|
60
|
-
formatUrl
|
|
61
|
-
});
|
|
62
33
|
|
|
34
|
+
exports.formatUrl = formatUrl;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/util-format-url",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.910.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "node ../../scripts/compilation/inline util-format-url",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@aws-sdk/types": "3.
|
|
26
|
-
"@smithy/querystring-builder": "^4.2.
|
|
27
|
-
"@smithy/types": "^4.
|
|
25
|
+
"@aws-sdk/types": "3.910.0",
|
|
26
|
+
"@smithy/querystring-builder": "^4.2.2",
|
|
27
|
+
"@smithy/types": "^4.7.1",
|
|
28
28
|
"tslib": "^2.6.2"
|
|
29
29
|
},
|
|
30
30
|
"engines": {
|