@ecency/sdk 1.5.3 → 1.5.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.
- package/dist/browser/index.js +10 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +10 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +10 -1
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.cjs
CHANGED
|
@@ -4549,7 +4549,16 @@ async function parseJsonResponse3(response) {
|
|
|
4549
4549
|
error.data = errorData;
|
|
4550
4550
|
throw error;
|
|
4551
4551
|
}
|
|
4552
|
-
|
|
4552
|
+
const text = await response.text();
|
|
4553
|
+
if (!text || text.trim() === "") {
|
|
4554
|
+
return "";
|
|
4555
|
+
}
|
|
4556
|
+
try {
|
|
4557
|
+
return JSON.parse(text);
|
|
4558
|
+
} catch (e) {
|
|
4559
|
+
console.warn("[SDK] Failed to parse JSON response:", e, "Response:", text);
|
|
4560
|
+
return "";
|
|
4561
|
+
}
|
|
4553
4562
|
}
|
|
4554
4563
|
async function signUp(username, email, referral) {
|
|
4555
4564
|
const fetchApi = getBoundFetch();
|