MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / rankResponseSample

Function rankResponseSample

packages/core/sdk/src/health-check.ts:662–675  ·  view source on GitHub ↗
(
  sample: readonly HealthCheckResponseSample[],
)

Source from the content-addressed store, hash-verified

660 * order. Every surface that renders a probe response uses this, so the
661 * interesting fields always lead. Stable within tiers. */
662export const rankResponseSample = (
663 sample: readonly HealthCheckResponseSample[],
664): HealthCheckResponseSample[] =>
665 sample
666 .map((row, index) => ({ row, index, tier: identityPathTier(row.path) }))
667 .sort((a, b) => {
668 if (a.tier !== b.tier) {
669 if (a.tier === -1) return 1;
670 if (b.tier === -1) return -1;
671 return a.tier - b.tier;
672 }
673 return a.index - b.index;
674 })
675 .map(({ row }) => row);

Callers 4

RequestCheckPanelFunction · 0.85
AddAccountModalViewFunction · 0.85

Calls 1

identityPathTierFunction · 0.85

Tested by

no test coverage detected