@globalbrain/sefirot 4.43.3 → 4.43.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.
@@ -42,22 +42,11 @@ export function objectToFormData(
42
42
  }
43
43
 
44
44
  export function getHttpStatusCode(error: any): number | undefined {
45
- const candidates = [
46
- error?.status,
47
- error?.statusCode,
48
- error?.response?.status,
49
- error?.response?.statusCode,
50
- error?.error?.status,
51
- error?.error?.statusCode,
52
- error?.details?.status,
53
- error?.details?.statusCode,
54
- error?.cause?.status,
55
- error?.cause?.statusCode,
56
- error?.cause?.response?.status,
57
- error?.cause?.response?.statusCode,
58
- error?.code,
59
- error?.cause?.code
60
- ]
61
-
62
- return candidates.map(Number).find((n) => Number.isInteger(n) && n >= 100 && n <= 599)
45
+ const sources = [error, error?.cause, error?.details, error?.error]
46
+ .filter((s) => s && typeof s === 'object')
47
+
48
+ return sources
49
+ .flatMap((s) => [s.status, s.statusCode, s.response?.status, s.response?.statusCode, s.code])
50
+ .map(Number)
51
+ .find((n) => Number.isInteger(n) && n >= 100 && n <= 599)
63
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
- "version": "4.43.3",
3
+ "version": "4.43.4",
4
4
  "description": "Vue Components for Global Brain Design System.",
5
5
  "keywords": [
6
6
  "components",