@smithy/querystring-builder 4.1.1 → 4.2.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 +21 -47
  2. package/package.json +3 -3
package/dist-cjs/index.js CHANGED
@@ -1,52 +1,26 @@
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);
1
+ 'use strict';
2
+
3
+ var utilUriEscape = require('@smithy/util-uri-escape');
19
4
 
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- buildQueryString: () => buildQueryString
24
- });
25
- module.exports = __toCommonJS(index_exports);
26
- var import_util_uri_escape = require("@smithy/util-uri-escape");
27
5
  function buildQueryString(query) {
28
- const parts = [];
29
- for (let key of Object.keys(query).sort()) {
30
- const value = query[key];
31
- key = (0, import_util_uri_escape.escapeUri)(key);
32
- if (Array.isArray(value)) {
33
- for (let i = 0, iLen = value.length; i < iLen; i++) {
34
- parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i])}`);
35
- }
36
- } else {
37
- let qsEntry = key;
38
- if (value || typeof value === "string") {
39
- qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`;
40
- }
41
- parts.push(qsEntry);
6
+ const parts = [];
7
+ for (let key of Object.keys(query).sort()) {
8
+ const value = query[key];
9
+ key = utilUriEscape.escapeUri(key);
10
+ if (Array.isArray(value)) {
11
+ for (let i = 0, iLen = value.length; i < iLen; i++) {
12
+ parts.push(`${key}=${utilUriEscape.escapeUri(value[i])}`);
13
+ }
14
+ }
15
+ else {
16
+ let qsEntry = key;
17
+ if (value || typeof value === "string") {
18
+ qsEntry += `=${utilUriEscape.escapeUri(value)}`;
19
+ }
20
+ parts.push(qsEntry);
21
+ }
42
22
  }
43
- }
44
- return parts.join("&");
23
+ return parts.join("&");
45
24
  }
46
- __name(buildQueryString, "buildQueryString");
47
- // Annotate the CommonJS export names for ESM import in node:
48
-
49
- 0 && (module.exports = {
50
- buildQueryString
51
- });
52
25
 
26
+ exports.buildQueryString = buildQueryString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/querystring-builder",
3
- "version": "4.1.1",
3
+ "version": "4.2.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline querystring-builder",
@@ -23,8 +23,8 @@
23
23
  "license": "Apache-2.0",
24
24
  "sideEffects": false,
25
25
  "dependencies": {
26
- "@smithy/types": "^4.5.0",
27
- "@smithy/util-uri-escape": "^4.1.0",
26
+ "@smithy/types": "^4.6.0",
27
+ "@smithy/util-uri-escape": "^4.2.0",
28
28
  "tslib": "^2.6.2"
29
29
  },
30
30
  "engines": {