File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,9 @@ const IPY_MODEL_ = 'IPY_MODEL_';
3737/**
3838 * A best-effort method for performing deep copies.
3939 */
40- const deepcopy =
41- globalThis . structuredClone || ( ( x : any ) => JSON . parse ( JSON . stringify ( x ) ) ) ;
40+ const deepcopyJSON = ( x : JSONValue ) => JSON . parse ( JSON . stringify ( x ) ) ;
41+
42+ const deepcopy = globalThis . structuredClone || deepcopyJSON ;
4243
4344/**
4445 * Replace model ids with models recursively.
@@ -572,7 +573,7 @@ export class WidgetModel extends Backbone.Model {
572573
573574 if ( serialize == null && keySerializers . deserialize === unpack_models ) {
574575 // handle https://github.com/jupyter-widgets/ipywidgets/issues/3735
575- serialize = pack_models ;
576+ serialize = deepcopyJSON ;
576577 }
577578
578579 if ( serialize ) {
You can’t perform that action at this time.
0 commit comments