hostinger-api-sdk 2.6.1 → 2.6.2
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/README.md +2 -2
- package/api.ts +545 -545
- package/common.ts +13 -0
- package/configuration.ts +1 -1
- package/dist/api.js +544 -544
- package/dist/common.d.ts +6 -0
- package/dist/common.js +14 -1
- package/dist/configuration.js +1 -1
- package/dist/esm/api.js +545 -545
- package/dist/esm/common.d.ts +6 -0
- package/dist/esm/common.js +12 -0
- package/dist/esm/configuration.js +1 -1
- package/package.json +1 -1
package/common.ts
CHANGED
|
@@ -32,6 +32,19 @@ export const assertParamExists = function (functionName: string, paramName: stri
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Empty values and dot segments survive encoding and collapse or resolve away, which would change the endpoint.
|
|
37
|
+
* @throws {RequiredError}
|
|
38
|
+
* @export
|
|
39
|
+
*/
|
|
40
|
+
export const encodePathParam = function (paramName: string, paramValue: unknown) {
|
|
41
|
+
const value = String(paramValue);
|
|
42
|
+
if (value === '' || value === '.' || value === '..') {
|
|
43
|
+
throw new RequiredError(paramName, `Invalid value for path parameter ${paramName}.`);
|
|
44
|
+
}
|
|
45
|
+
return encodeURIComponent(value);
|
|
46
|
+
}
|
|
47
|
+
|
|
35
48
|
/**
|
|
36
49
|
*
|
|
37
50
|
* @export
|
package/configuration.ts
CHANGED