Skip to main content

Function: createSafeTypeOperationCounter()

createSafeTypeOperationCounter<Reason>(reasonsForTypeInference?: readonly Reason[]): SafeTypeOperationCounter<Reason>

Defined in: _internal/safe-type-operation.ts:223

Build a lightweight reason counter for debugging operation failures in tests.

Type Parametersโ€‹

Reasonโ€‹

Reason extends string = never

Parametersโ€‹

reasonsForTypeInference?โ€‹

readonly Reason[] = []

Optional typed reason literals used to infer the Reason generic without requiring explicit type parameters.

Returnsโ€‹

SafeTypeOperationCounter<Reason>