MCPcopy
hub / github.com/jestjs/jest / packMessage

Function packMessage

packages/jest-worker/src/workers/safeMessageTransferring.ts:19–30  ·  view source on GitHub ↗
(message: unknown)

Source from the content-addressed store, hash-verified

17};
18
19export function packMessage(message: unknown): TransferringContainer {
20 return {
21 __STRUCTURED_CLONE_SERIALIZED__: true,
22 /**
23 * Use the `json: true` option to avoid errors
24 * caused by `function` or `symbol` types.
25 * It's not ideal to lose `function` and `symbol` types,
26 * but reliability is more important.
27 */
28 data: serialize(message, {json: true}),
29 };
30}
31
32function isTransferringContainer(
33 message: unknown,

Callers 3

reportSuccessFunction · 0.90
messageParentFunction · 0.90
reportSuccessFunction · 0.90

Calls 1

serializeFunction · 0.50

Tested by

no test coverage detected