aractingi commited on
Commit
5fe6175
·
1 Parent(s): 62b026a

Added check for v3.0

Browse files
Files changed (1) hide show
  1. src/utils/versionUtils.ts +9 -4
src/utils/versionUtils.ts CHANGED
@@ -43,10 +43,15 @@ async function checkVersionExists(repoId: string, version: string): Promise<bool
43
 
44
  /**
45
  * Determines the best available version for a dataset.
46
- * Prefers v2.1, falls back to v2.0, or throws an error if neither exists.
47
  */
48
  export async function getDatasetVersion(repoId: string): Promise<string> {
49
- // Check for v2.1 first
 
 
 
 
 
50
  if (await checkVersionExists(repoId, "v2.1")) {
51
  return "v2.1";
52
  }
@@ -56,10 +61,10 @@ export async function getDatasetVersion(repoId: string): Promise<string> {
56
  return "v2.0";
57
  }
58
 
59
- // If neither v2.1 nor v2.0 exists, throw an error
60
  throw new Error(
61
  `Dataset ${repoId} is not compatible with this visualizer. ` +
62
- "This tool only works with dataset version 2.x (v2.1 or v2.0). " +
63
  "Please use a compatible dataset version."
64
  );
65
  }
 
43
 
44
  /**
45
  * Determines the best available version for a dataset.
46
+ * Prefers v3.0, falls back to v2.1, then v2.0, or throws an error if none exist.
47
  */
48
  export async function getDatasetVersion(repoId: string): Promise<string> {
49
+ // Check for v3.0 first
50
+ if (await checkVersionExists(repoId, "v3.0")) {
51
+ return "v3.0";
52
+ }
53
+
54
+ // Check for v2.1
55
  if (await checkVersionExists(repoId, "v2.1")) {
56
  return "v2.1";
57
  }
 
61
  return "v2.0";
62
  }
63
 
64
+ // If none of the supported versions exist, throw an error
65
  throw new Error(
66
  `Dataset ${repoId} is not compatible with this visualizer. ` +
67
+ "This tool only works with dataset versions 3.0, 2.1, or 2.0. " +
68
  "Please use a compatible dataset version."
69
  );
70
  }