wireCopy() function

Copies a value the way the queue does: through JSON and back.

Signature:

export declare function wireCopy<T extends object>(value: T): T;

Parameters

Parameter

Type

Description

value

T

an object to copy

Returns:

T

the copy, which shares nothing with the value

Remarks

This is what keeps an in-process call's semantics those of a queued one: a Date arrives as its ISO string, a class instance as a plain object, undefined properties are gone and undefined array items are null, and neither side can change an object the other still holds. It throws where the queue would fail to send, on a BigInt or a cycle.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.