We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6931ee8 commit 3268870Copy full SHA for 3268870
src/utils/dataLoader.ts
@@ -29,6 +29,16 @@ export async function loadData(
29
throw new Error(`Received empty or invalid JSON`);
30
}
31
32
+ if (Array.isArray(data)) {
33
+ console.log(`Received JSON array with ${data.length} items`);
34
+ } else if (typeof data === "object") {
35
+ console.log(
36
+ `Received JSON object with ${Object.keys(data).length} keys`
37
+ );
38
+ } else {
39
+ console.log(`Received JSON of type: ${typeof data}`);
40
+ }
41
+
42
return data;
43
} catch (error) {
44
console.error(`Attempt ${attempt} failed:`, error);
@@ -42,6 +52,4 @@ export async function loadData(
52
53
54
45
-
46
- throw new Error(`Unexpected execution path`);
47
55
0 commit comments