controllers/transactions/lib/tx-state-history-helper

Methods

(inner) generateHistoryEntry(previousState, newState, note) → {array}

Source:

Generates an array of history objects sense the previous state. The object has the keys op (the operation performed), path (the key and if a nested object then each key will be seperated with a /) value with the first entry having the note and a timestamp when the change took place

Parameters:
Name Type Description
previousState object

the previous state of the object

newState object

the update object

note string

a optional note for the state change

Returns:
Type
array

(inner) migrateFromSnapshotsToDiffs(longHistory) → {array}

Source:

converts non-initial history entries into diffs

Parameters:
Name Type Description
longHistory array
Returns:
Type
array

(inner) replayHistory() → {object}

Source:

Recovers previous txMeta state obj

Returns:
Type
object

(inner) snapshotFromTxMeta(txMeta) → {object}

Source:
Parameters:
Name Type Description
txMeta Object
Returns:

a clone object of the txMeta with out history

Type
object