Skip to content

@arcmantle/chronicle / array-mutations

array-mutations

Functions

captureShrinkRemovals()

captureShrinkRemovals(targetArray, oldLen, newLen): object[]

Defined in: array-mutations.ts:13

Capture array elements that will be removed when shrinking array length.

Parameters

targetArray

any[]

The array being modified

oldLen

number

The current length

newLen

number

The new (smaller) length

Returns

object[]

Array of {index, value} pairs for elements that will be removed


deleteIndex()

deleteIndex(root, arrayTarget, index): boolean

Defined in: array-mutations.ts:35

Delete an array element by index using splice to avoid sparse arrays. Suspends write notifications during the splice to avoid noisy intermediate records.

Parameters

root

object

The root object (for suspend/resume context)

arrayTarget

any[]

The array to modify

index

number

The numeric index to delete

Returns

boolean

true if deletion succeeded


isArrayIndexDeletion()

isArrayIndexDeletion(target, key): boolean

Defined in: array-mutations.ts:63

Check if a delete operation is for an array index.

Parameters

target

any

The target object

key

string

The normalized key

Returns

boolean

true if this is an array index deletion

Released under the Apache-2.0 License.