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

Function rankResponseSample

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

Source from the content-addressed store, hash-verified

456 * order. Every surface that renders a probe response uses this, so the
457 * interesting fields always lead. Stable within tiers. */
458export const rankResponseSample = (
459 sample: readonly HealthCheckResponseSample[],
460): HealthCheckResponseSample[] =>
461 sample
462 .map((row, index) => ({ row, index, tier: identityPathTier(row.path) }))
463 .sort((a, b) => {
464 if (a.tier !== b.tier) {
465 if (a.tier === -1) return 1;
466 if (b.tier === -1) return -1;
467 return a.tier - b.tier;
468 }
469 return a.index - b.index;
470 })
471 .map(({ row }) => row);

Callers 4

RequestCheckPanelFunction · 0.85
AddAccountModalViewFunction · 0.85

Calls 1

identityPathTierFunction · 0.85

Tested by

no test coverage detected