Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/ipynb/src/notebookSerializerWorker.web.ts
3292 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { serializeNotebookToString } from './serializers';
7
import type { NotebookData } from 'vscode';
8
9
onmessage = (e) => {
10
const data = e.data as { id: string; data: NotebookData };
11
const json = serializeNotebookToString(data.data);
12
const bytes = new TextEncoder().encode(json);
13
postMessage({ id: data.id, data: bytes });
14
};
15
16