Sports Lib API - v21.3.0
    Preparing search index...

    Function normalizeActivityMetricSemanticsForStats

    Canonicalizes unambiguous activity-summary semantics: cadence-shaped stroke-rate summaries become Stroke Rate, and homogeneous Diving-group summaries omit terrain metrics.

    • Canonicalizes summary metric semantics using every activity type represented by the stats.

      The target is mutated only when the supplied activity types are non-empty and all resolve to canonical Sports Lib activity types. Homogeneous stroke-rate summaries convert cadence-shaped values, while homogeneous Diving-group summaries remove terrain values that misrepresent dive vertical movement. Empty, unknown, and mixed-family inputs are preserved because their semantics are ambiguous. Explicit stroke-rate stats take precedence over cadence-shaped compatibility values.

      Host applications that persist summary-only projections can call this after restoring the projection and determining the activity types that contributed to it.

      Parameters

      • target: StatsClassInterface

        Stats-bearing model whose summary values should be canonicalized.

      • activityTypes: readonly unknown[]

        Activity types represented by the target summary.

      Returns void