@codingame/monaco-vscode-ipynb-default-extension 1.82.6 → 1.83.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ipynbMain.js +6 -8
- package/ipynbMain.js.map +1 -1
- package/package.json +2 -2
package/ipynbMain.js
CHANGED
|
@@ -71,7 +71,7 @@ class NotebookSerializer {
|
|
|
71
71
|
}
|
|
72
72
|
// For notebooks without metadata default the language in metadata to the preferred language.
|
|
73
73
|
if (!json.metadata || (!json.metadata.kernelspec && !json.metadata.language_info)) {
|
|
74
|
-
json.metadata = json.metadata || {
|
|
74
|
+
json.metadata = json.metadata || {};
|
|
75
75
|
json.metadata.language_info = json.metadata.language_info || { name: preferredCellLanguage };
|
|
76
76
|
}
|
|
77
77
|
const data = (0, deserializers_1.jupyterNotebookModelToNotebookData)(json, preferredCellLanguage);
|
|
@@ -100,9 +100,9 @@ exports.NotebookSerializer = NotebookSerializer;
|
|
|
100
100
|
function getNotebookMetadata(document) {
|
|
101
101
|
const notebookContent = document.metadata?.custom || {};
|
|
102
102
|
notebookContent.cells = notebookContent.cells || [];
|
|
103
|
-
notebookContent.nbformat = notebookContent.nbformat ||
|
|
104
|
-
notebookContent.nbformat_minor = notebookContent.nbformat_minor ??
|
|
105
|
-
notebookContent.metadata = notebookContent.metadata || {
|
|
103
|
+
notebookContent.nbformat = notebookContent.nbformat || constants_1.defaultNotebookFormat.major;
|
|
104
|
+
notebookContent.nbformat_minor = notebookContent.nbformat_minor ?? constants_1.defaultNotebookFormat.minor;
|
|
105
|
+
notebookContent.metadata = notebookContent.metadata || {};
|
|
106
106
|
return notebookContent;
|
|
107
107
|
}
|
|
108
108
|
exports.getNotebookMetadata = getNotebookMetadata;
|
|
@@ -777,7 +777,7 @@ function translateCellDisplayOutput(output) {
|
|
|
777
777
|
prev[curr.mime] = convertOutputMimeToJupyterOutput(curr.mime, curr.data);
|
|
778
778
|
return prev;
|
|
779
779
|
}, {}),
|
|
780
|
-
metadata: customMetadata?.metadata || {},
|
|
780
|
+
metadata: customMetadata?.metadata || {}, // This can never be undefined.
|
|
781
781
|
execution_count: typeof customMetadata?.executionCount === 'number' ? customMetadata?.executionCount : null // This can never be undefined, only a number or `null`.
|
|
782
782
|
};
|
|
783
783
|
break;
|
|
@@ -5019,9 +5019,7 @@ function activate(context) {
|
|
|
5019
5019
|
data.metadata = {
|
|
5020
5020
|
custom: {
|
|
5021
5021
|
cells: [],
|
|
5022
|
-
metadata: {
|
|
5023
|
-
orig_nbformat: 4
|
|
5024
|
-
},
|
|
5022
|
+
metadata: {},
|
|
5025
5023
|
nbformat: 4,
|
|
5026
5024
|
nbformat_minor: 2
|
|
5027
5025
|
}
|