Function: safeStructuredClone()
safeStructuredClone<
T>(value):T
Like structuredClone, but safe for annotation-style data: omits known large or non-cloneable keys (e.g. pointsInVolume, projectionPoints) and replaces any value that cannot be cloned with null if the whole clone fails. Use for cloning annotation data or other objects that may contain large arrays or non-cloneable references.
Type Parameters
• T
Parameters
• value: T
Any value (typically annotation data object).
Returns
T
Deep copy with omit-keys stripped and uncloneable values nulled on fallback.