lemmy-js-client 0.17.0-rc.36 → 0.17.0-rc.39
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http.js +11 -12
- package/package.json +3 -3
package/dist/http.js
CHANGED
@@ -999,25 +999,25 @@ var LemmyHttp = /** @class */ (function () {
|
|
999
999
|
return __generator(this, function (_a) {
|
1000
1000
|
if (type_ == HttpType.Get) {
|
1001
1001
|
getUrl = "".concat(this.buildFullUrl(endpoint), "?").concat(encodeGetParams(form));
|
1002
|
-
return [2 /*return*/, (
|
1002
|
+
return [2 /*return*/, (0, node_fetch_1.default)(getUrl, {
|
1003
1003
|
method: "GET",
|
1004
1004
|
headers: this.headers,
|
1005
|
-
})
|
1006
|
-
// TODO test this
|
1007
|
-
.then(function (d) {
|
1005
|
+
}).then(function (d) {
|
1008
1006
|
return d
|
1009
1007
|
.text()
|
1010
|
-
.then(function (a) {
|
1011
|
-
|
1012
|
-
});
|
1013
|
-
}))];
|
1008
|
+
.then(function (a) { return (0, class_transformer_1.deserialize)(responseClass, a); });
|
1009
|
+
})];
|
1014
1010
|
}
|
1015
1011
|
else {
|
1016
1012
|
return [2 /*return*/, (0, node_fetch_1.default)(this.buildFullUrl(endpoint), {
|
1017
1013
|
method: type_,
|
1018
1014
|
headers: __assign({ "Content-Type": "application/json" }, this.headers),
|
1019
1015
|
body: (0, class_transformer_1.serialize)(form),
|
1020
|
-
}).then(function (d) {
|
1016
|
+
}).then(function (d) {
|
1017
|
+
return d
|
1018
|
+
.text()
|
1019
|
+
.then(function (a) { return (0, class_transformer_1.deserialize)(responseClass, a); });
|
1020
|
+
})];
|
1021
1021
|
}
|
1022
1022
|
return [2 /*return*/];
|
1023
1023
|
});
|
@@ -1029,8 +1029,7 @@ exports.LemmyHttp = LemmyHttp;
|
|
1029
1029
|
function encodeGetParams(p) {
|
1030
1030
|
// Necessary to remove the Options
|
1031
1031
|
var serialized = JSON.parse((0, class_transformer_1.serialize)(p));
|
1032
|
-
return
|
1033
|
-
// TODO test this, it might serialize the undefineds
|
1032
|
+
return Object.entries(serialized)
|
1034
1033
|
.map(function (kv) { return kv.map(encodeURIComponent).join("="); })
|
1035
|
-
.join("&")
|
1034
|
+
.join("&");
|
1036
1035
|
}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "lemmy-js-client",
|
3
3
|
"description": "A javascript / typescript client for Lemmy",
|
4
|
-
"version": "0.17.0-rc.
|
4
|
+
"version": "0.17.0-rc.39",
|
5
5
|
"author": "Dessalines <tyhou13@gmx.com>",
|
6
6
|
"license": "AGPL-3.0",
|
7
7
|
"main": "./dist/index.js",
|
@@ -17,7 +17,7 @@
|
|
17
17
|
"repository": "https://github.com/LemmyNet/lemmy-js-client",
|
18
18
|
"devDependencies": {
|
19
19
|
"@sniptt/monads": "^0.5.10",
|
20
|
-
"@types/node": "^
|
20
|
+
"@types/node": "^18.6.2",
|
21
21
|
"@types/node-fetch": "^3.0.3",
|
22
22
|
"@typescript-eslint/eslint-plugin": "^5.31.0",
|
23
23
|
"@typescript-eslint/parser": "^5.31.0",
|
@@ -25,7 +25,7 @@
|
|
25
25
|
"eslint": "^8.20.0",
|
26
26
|
"eslint-plugin-prettier": "^4.2.1",
|
27
27
|
"husky": "^8.0.1",
|
28
|
-
"lint-staged": "^
|
28
|
+
"lint-staged": "^13.0.3",
|
29
29
|
"node-fetch": "^3.2.9",
|
30
30
|
"prettier": "^2.7.1",
|
31
31
|
"prettier-plugin-import-sort": "^0.0.7",
|