bulltrackers-module 1.0.635 → 1.0.636

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.
@@ -44,7 +44,9 @@ async function fetchDependencies(date, calcs, config, deps, manifestLookup = {})
44
44
  const dStr = date.toISOString().slice(0, 10);
45
45
 
46
46
  // 1. Identify unique dependencies needed
47
- const needed = new Set();
47
+ // CHANGED: Use a Map to track { normalizedName: originalName }
48
+ const needed = new Map();
49
+
48
50
  calcs.forEach(c => {
49
51
  // [FIX] Support both .getDependencies() method and .dependencies array
50
52
  const reqs = (typeof c.getDependencies === 'function')
@@ -52,7 +54,12 @@ async function fetchDependencies(date, calcs, config, deps, manifestLookup = {})
52
54
  : (c.dependencies || []);
53
55
 
54
56
  if (Array.isArray(reqs)) {
55
- reqs.forEach(r => needed.add(normalizeName(r)));
57
+ reqs.forEach(r => {
58
+ // We map the normalized version to the original requested version
59
+ // This ensures we fetch the right file (normalized) but return it
60
+ // with the casing the user code expects (original).
61
+ needed.set(normalizeName(r), r);
62
+ });
56
63
  }
57
64
  });
58
65
 
@@ -61,14 +68,20 @@ async function fetchDependencies(date, calcs, config, deps, manifestLookup = {})
61
68
  logger.log('INFO', `[DependencyFetcher] Fetching ${needed.size} dependencies for ${dStr}`);
62
69
 
63
70
  const results = {};
64
- const promises = Array.from(needed).map(async (name) => {
71
+ // CHANGED: Iterate over the entries to access both normalized and original names
72
+ const promises = Array.from(needed.entries()).map(async ([normName, originalName]) => {
65
73
  try {
66
74
  // Resolve Category from Lookup, default to 'analytics' if unknown
67
- const category = manifestLookup[name] || 'analytics';
68
- const data = await fetchSingleResult(db, config, dStr, name, category);
69
- if (data) results[name] = data;
75
+ // Note: manifestLookup keys are expected to be normalized
76
+ const category = manifestLookup[normName] || 'analytics';
77
+
78
+ // Fetch using the normalized name (system standard)
79
+ const data = await fetchSingleResult(db, config, dStr, normName, category);
80
+
81
+ // CHANGED: Store result using the ORIGINAL name so context.computed['CaseSensitive'] works
82
+ if (data) results[originalName] = data;
70
83
  } catch (e) {
71
- logger.log('WARN', `[DependencyFetcher] Failed to load dependency ${name}: ${e.message}`);
84
+ logger.log('WARN', `[DependencyFetcher] Failed to load dependency ${originalName}: ${e.message}`);
72
85
  }
73
86
  });
74
87
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulltrackers-module",
3
- "version": "1.0.635",
3
+ "version": "1.0.636",
4
4
  "description": "Helper Functions for Bulltrackers.",
5
5
  "main": "index.js",
6
6
  "files": [