@ecency/sdk 1.5.3 → 1.5.5

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.
@@ -1260,7 +1260,7 @@ function filterDmcaEntry(entryOrEntries) {
1260
1260
  function applyFilter(entry) {
1261
1261
  if (!entry) return entry;
1262
1262
  const entryPath = `@${entry.author}/${entry.permlink}`;
1263
- const isDmca = CONFIG.dmcaPatternRegexes.some((regex) => regex.test(entryPath));
1263
+ const isDmca = CONFIG.dmcaPatterns.includes(entryPath) || CONFIG.dmcaPatternRegexes.some((regex) => regex.test(entryPath));
1264
1264
  if (isDmca) {
1265
1265
  return {
1266
1266
  ...entry,
@@ -4524,7 +4524,16 @@ async function parseJsonResponse3(response) {
4524
4524
  error.data = errorData;
4525
4525
  throw error;
4526
4526
  }
4527
- return await response.json();
4527
+ const text = await response.text();
4528
+ if (!text || text.trim() === "") {
4529
+ return "";
4530
+ }
4531
+ try {
4532
+ return JSON.parse(text);
4533
+ } catch (e) {
4534
+ console.warn("[SDK] Failed to parse JSON response:", e, "Response:", text);
4535
+ return "";
4536
+ }
4528
4537
  }
4529
4538
  async function signUp(username, email, referral) {
4530
4539
  const fetchApi = getBoundFetch();