Skip to content

Commit e7d9e07

Browse files
committed
use structured clonning
1 parent e58d440 commit e7d9e07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/notebooks/deepnote/deepnoteCellCopyHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export class DeepnoteCellCopyHandler implements IExtensionSyncActivationService
160160

161161
// Copy all metadata (ID and sortingKey will be generated by onDidChangeNotebookDocument)
162162
if (cellToCopy.metadata) {
163-
const copiedMetadata = { ...cellToCopy.metadata };
163+
const copiedMetadata = structuredClone(cellToCopy.metadata);
164164
newCell.metadata = copiedMetadata;
165165
logger.debug('DeepnoteCellCopyHandler: Copying cell with metadata preserved');
166166
}
@@ -171,7 +171,7 @@ export class DeepnoteCellCopyHandler implements IExtensionSyncActivationService
171171
(o) =>
172172
new NotebookCellOutput(
173173
o.items.map((i) => new NotebookCellOutputItem(i.data, i.mime)),
174-
o.metadata ? { ...o.metadata } : undefined
174+
o.metadata ? structuredClone(o.metadata) : undefined
175175
)
176176
);
177177
}

0 commit comments

Comments
 (0)