Skip to content

ts-ds / replay

Function: replay() ​

ts
function replay<T>(
   input, 
   steps, 
   count?
): T[];

Defined in: trace/trace.ts:160

Applies the steps to a copy of input and returns the array after the first count steps. replay(trace.input, trace.steps) equals trace.output.

Type Parameters ​

Type ParameterDescription
T

Parameters ​

ParameterTypeDefault valueDescription
inputreadonly T[]undefinedThe array before sorting.
stepsreadonly Step<T>[]undefinedSteps from trace.
count?numbersteps.lengthHow many steps to apply, all by default.

Returns ​

T[]

The state of the array after these steps.

MIT License