Skip to content

Commit 969510e

Browse files
committed
refactor: remove use of structuredClone()
1 parent 98c8516 commit 969510e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/client.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,12 @@ class RPCClient extends EventEmitter {
406406
this._connectPromise = (async () => {
407407
this._wsAbortController = new AbortController();
408408

409-
const wsOpts = structuredClone(this._options.wsOpts ?? {});
410-
wsOpts.noDelay = true;
411-
wsOpts.signal = this._wsAbortController.signal;
412-
wsOpts.headers = wsOpts.headers ?? {};
409+
const wsOpts = Object.assign({}, {
410+
// defaults
411+
noDelay: true,
412+
signal: this._wsAbortController.signal,
413+
headers: {},
414+
}, this._options.wsOpts ?? {});
413415

414416
Object.assign(wsOpts.headers, this._options.headers);
415417

0 commit comments

Comments
 (0)