Skip to content

@arcmantle/chronicle / history-recorder

history-recorder

Functions

recordArrayShrinkDeletes()

recordArrayShrinkDeletes(root, basePath, removed, groupId): void

Defined in: history-recorder.ts:122

Record delete operations for array elements removed by length shrinkage.

Used when array.length is decreased, synthesizing delete records for removed indices. Does not apply compaction or other optimizations - just records the deletes.

Parameters

root

object

The root object

basePath

string[]

The path to the array (not including indices)

removed

object[]

Array of {index, value} pairs that were removed

groupId

string

The group ID for these changes

Returns

void


recordDelete()

recordDelete(root, path, oldValue, groupId): void

Defined in: history-recorder.ts:81

Record a 'delete' operation in history with filtering and trimming.

Parameters

root

object

The root object

path

string[]

The path where the delete occurred

oldValue

any

The value that was deleted

groupId

string

The group ID for this change

Returns

void


recordSet()

recordSet(root, path, oldValue, newValue, existedBefore, groupId): void

Defined in: history-recorder.ts:21

Record a 'set' operation in history with filtering, compaction, and trimming.

Handles optional compaction of consecutive sets on the same path within the same group, avoiding compaction of array indices and length properties.

Parameters

root

object

The root object

path

string[]

The path where the set occurred

oldValue

any

The previous value

newValue

any

The new value

existedBefore

boolean

Whether the property existed before

groupId

string

The group ID for this change

Returns

void

Released under the Apache-2.0 License.