rankScoredSubjects()
Ranks scored subjects by score desc, then policy tie-breakers, then stable order and subjectId.
Import
Section titled “Import”import { rankScoredSubjects } from "@graphrefly/ts/scoring";Signature
Section titled “Signature”function rankScoredSubjects( scored: readonly ScoredSubject<T>[], policy?: Pick<ScorePolicy, "tieBreakers">,): readonly ScoredSubject<T>[]Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
scored | readonly ScoredSubject<T>[] | scored value used by the helper. |
policy | Pick<ScorePolicy, "tieBreakers"> | Policy object used to admit, retry, or route work. |
Returns
Section titled “Returns”A readonly ScoredSubject<T>[] value.
Example
Section titled “Example”import { rankScoredSubjects } from "@graphrefly/ts/scoring";Source
Section titled “Source”packages/ts/src/scoring/helpers.ts