Skip to content

Commit

Permalink
fix: do not deep-clone old log config in updateOptions (#7173)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone authored Sep 17, 2024
1 parent 4d3c928 commit 61d187b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/zwave-js/src/lib/driver/Driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1093,12 +1093,14 @@ export class Driver extends TypedEventEmitter<DriverEventCallbacks>
]);

// Create a new deep-merged copy of the options so we can check them for validity
// without affecting our own options
// without affecting our own options. logConfig is potentially unsafe to clone, so just preserve it.
const { logConfig, ...rest } = this._options;
const newOptions = mergeDeep(
cloneDeep(this._options),
cloneDeep(rest),
safeOptions,
true,
) as ZWaveOptions;
newOptions.logConfig = logConfig;
checkOptions(newOptions);

if (options.userAgent && !isObject(options.userAgent)) {
Expand Down

0 comments on commit 61d187b

Please sign in to comment.