MCPcopy Create free account
hub / github.com/Thanas-R/Virdis / buildAnalyticsCacheKey

Function buildAnalyticsCacheKey

supabase/functions/gee-analytics/index.ts:20–23  ·  view source on GitHub ↗
(coords: [number, number][], analyses: string[])

Source from the content-addressed store, hash-verified

18}
19
20function buildAnalyticsCacheKey(coords: [number, number][], analyses: string[]) {
21 const normalizedCoords = coords.map(([lon, lat]) => [Number(lon.toFixed(5)), Number(lat.toFixed(5))]);
22 return JSON.stringify({ coords: normalizedCoords, analyses: [...analyses].sort() });
23}
24
25function getCachedAnalytics(key: string, allowStale = false) {
26 const cached = analyticsCache.get(key);

Callers 1

index.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected