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 Parameter | Description |
|---|---|
T |
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
input | readonly T[] | undefined | The array before sorting. |
steps | readonly Step<T>[] | undefined | Steps from trace. |
count? | number | steps.length | How many steps to apply, all by default. |
Returns
T[]
The state of the array after these steps.