@lonca/trendyol 0.11.2 → 0.11.3

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/testing.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createRequester, LoncaError, ServerError, RateLimitError, NotFoundError, ValidationError, AuthError, TokenBucketRateLimiter, TimeoutError } from '@lonca/core';
1
+ import { createRequester, LoncaError, ServerError, RateLimitError, NotFoundError, ValidationError, AuthError, TokenBucketRateLimiter, normalizeIssueEntries, TimeoutError } from '@lonca/core';
2
2
 
3
3
  // src/resources/brands.ts
4
4
  var DEFAULT_PAGE_SIZE = 1e3;
@@ -2750,23 +2750,7 @@ function mapHttpError(status, body, retryAfterMs) {
2750
2750
  }
2751
2751
  function normalizeErrorIssues(body) {
2752
2752
  const errors = extractErrorsArray(body);
2753
- if (!errors) return [];
2754
- const issues = [];
2755
- for (const entry of errors) {
2756
- if (typeof entry === "string") {
2757
- issues.push({ message: entry });
2758
- continue;
2759
- }
2760
- if (entry && typeof entry === "object") {
2761
- const e = entry;
2762
- if (typeof e.message !== "string") continue;
2763
- const issue = { message: e.message };
2764
- if (typeof e.field === "string") issue.field = e.field;
2765
- if (typeof e.code === "string") issue.code = e.code;
2766
- issues.push(issue);
2767
- }
2768
- }
2769
- return issues;
2753
+ return errors ? normalizeIssueEntries(errors) : [];
2770
2754
  }
2771
2755
  function extractErrorsArray(body) {
2772
2756
  if (!body || typeof body !== "object") return void 0;