mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
Release God's Eye View as open source
This commit is contained in:
1 parent
a5aaea7e16
commit
880a672b5e
433 files changed
+219893
-23
No files matched your search
@@ -0,0 +1,21 @@
|
||||
// src/data/aircraftMeta.js
|
||||
/**
|
||||
* Sticky per-aircraft metadata merge: once a field has resolved for an
|
||||
* aircraft, a later snapshot that MISSES the field (empty/null — OpenSky and
|
||||
* adsb.lol both do this intermittently) must not regress it. A later snapshot
|
||||
* that CHANGES the field always wins. Pattern from skylight (MIT)
|
||||
* server/src/datasource.ts "sticky enrichment".
|
||||
*/
|
||||
|
||||
export function stickyText(next, prev) {
|
||||
const n = String(next || '').trim();
|
||||
if (n) return n;
|
||||
const p = String(prev || '').trim();
|
||||
return p || '';
|
||||
}
|
||||
|
||||
export function stickyNumber(next, prev, fallback) {
|
||||
if (Number.isFinite(next)) return next;
|
||||
if (Number.isFinite(prev)) return prev;
|
||||
return fallback;
|
||||
}
|
||||
Reference in new issue
Block a user