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_';
37
37
/**
38
38
* A best-effort method for performing deep copies.
39
39
*/
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 ;
42
43
43
44
/**
44
45
* Replace model ids with models recursively.
@@ -572,7 +573,7 @@ export class WidgetModel extends Backbone.Model {
572
573
573
574
if ( serialize == null && keySerializers . deserialize === unpack_models ) {
574
575
// handle https://github.com/jupyter-widgets/ipywidgets/issues/3735
575
- serialize = pack_models ;
576
+ serialize = deepcopyJSON ;
576
577
}
577
578
578
579
if ( serialize ) {
You can’t perform that action at this time.
0 commit comments