nextemos 3.3.3 → 3.3.4
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.
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a given object into a query string format.
|
|
3
|
+
*
|
|
4
|
+
* @param obj - The object to be converted into a query string.
|
|
5
|
+
* @returns {string} - The query string representation of the object.
|
|
6
|
+
*/
|
|
7
|
+
export declare const toQueryString: (obj: Record<string, any>) => string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toQueryString = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Converts a given object into a query string format.
|
|
6
|
+
*
|
|
7
|
+
* @param obj - The object to be converted into a query string.
|
|
8
|
+
* @returns {string} - The query string representation of the object.
|
|
9
|
+
*/
|
|
10
|
+
const toQueryString = (obj) => {
|
|
11
|
+
const queryString = [];
|
|
12
|
+
for (const key in obj) {
|
|
13
|
+
if (obj.hasOwnProperty(key)) {
|
|
14
|
+
const value = encodeURIComponent(obj[key]);
|
|
15
|
+
queryString.push(`${encodeURIComponent(key)}=${value}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return queryString.join('&');
|
|
19
|
+
};
|
|
20
|
+
exports.toQueryString = toQueryString;
|