mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
style(mcp): tighten the metric index note
This commit is contained in:
1 parent
f8a88d1361
commit
a57fa8335a
1 file changed
+7
-15
@@ -551,21 +551,13 @@ export async function metricStatusDiscoveryRows(userId: string): Promise<
|
|||||||
//
|
//
|
||||||
// Every OTHER measurement type is still entered, value-less, because
|
// Every OTHER measurement type is still entered, value-less, because
|
||||||
// ambiguity has to be judged over the whole label space rather than over the
|
// ambiguity has to be judged over the whole label space rather than over the
|
||||||
// exposed slice of it. French and Italian once called body fat and fat mass
|
// exposed slice of it: French and Italian once named body fat and fat mass
|
||||||
// by one phrase ("masse grasse" / "massa grassa") while only one of the two
|
// alike while only one was exposed, which answered kilograms to a question
|
||||||
// was exposed, so an index that knew about the exposed one alone would have
|
// about a percentage. The alias tables stay English (`resting_hr`, `spo2`
|
||||||
// seen no collision and answered kilograms to someone who asked for a
|
// are protocol slugs). Built on first use: the index reads every catalog.
|
||||||
// percentage. Those labels are distinct now; the whole-space check stays so a
|
let metricIndex: ReturnType<typeof buildLocalisedMetricIndex> | undefined;
|
||||||
// future bundle cannot reintroduce the trap unseen.
|
const localisedMetricIndex = () =>
|
||||||
//
|
(metricIndex ??= buildLocalisedMetricIndex());
|
||||||
// The alias tables stay as they are and stay English: `resting_hr`, `spo2`,
|
|
||||||
// `vo2max` are protocol slugs, not translations of anything.
|
|
||||||
let localisedMetricIndexCache:
|
|
||||||
ReturnType<typeof buildLocalisedMetricIndex> | undefined;
|
|
||||||
/** Built on first use, not at module load: it reads every shipped catalog. */
|
|
||||||
function localisedMetricIndex(): ReturnType<typeof buildLocalisedMetricIndex> {
|
|
||||||
return (localisedMetricIndexCache ??= buildLocalisedMetricIndex());
|
|
||||||
}
|
|
||||||
function buildLocalisedMetricIndex() {
|
function buildLocalisedMetricIndex() {
|
||||||
const exposed = new Map<MeasurementType, RichMetric>();
|
const exposed = new Map<MeasurementType, RichMetric>();
|
||||||
const claim = (metric: RichMetric | null) => {
|
const claim = (metric: RichMetric | null) => {
|
||||||
|
|||||||
Reference in new issue
Block a user