wrapScorer()
Transform the output or expected value before passing them to an existing scorer. The wrapper preserves the scorer's name and forwards input and extra case fields.
Import
Signature
Parameters
Parameters
scorerScorer<INNER_OUTPUT, INNER_EXPECTED, EXTRA>required
The scorer receiving the transformed values.
optionsWrapScorerOptionsrequired
Synchronous transformations. Omitted transformations pass the original value through.
Example
Return value and errors
Returns a scorer with the outer OUTPUT and EXPECTED types. The inner scorer's
score and metadata are returned unchanged. Transformations are not awaited.
Exceptions propagate to the evaluator and fail the case.
See createScorer() for the scorer callback contract.