ObjectRecorder

ObjectRecorder

Record objects that pass by in a stream. If the same object is used more than once, it can be value-shared using shared values.

Constructor

new ObjectRecorder()

Source:
See:

Methods

check(obj) → {number}

Description:
  • Determine if wrapping a tag 28 or 29 around an object that has been reused is appropriate. This method stores state for which objects have been seen.
Source:
Parameters:
Name Type Description
obj object Any object about to be serialized.
Throws:
Recording does not match playback.
Type
Error
Returns:
If recording: -1 for first use, index for second use. If not recording, -1 for never-duplicated, -2 for first use, index for subsequent uses.
Type
number

clear()

Description:
  • Clear all of the objects that have been seen. Revert to recording mode.
Source:

stop()

Description:
  • Stop recording.
Source: