@jupyterlab/docregistry
Advanced tools
Comparing version 4.2.0-alpha.0 to 4.2.0-alpha.1
@@ -582,7 +582,21 @@ // Copyright (c) Jupyter Development Team. | ||
getFileTypeForModel(model) { | ||
let ft = null; | ||
if (model.name || model.path) { | ||
const name = model.name || PathExt.basename(model.path); | ||
const fts = this.getFileTypesForPath(name); | ||
if (fts.length > 0) { | ||
ft = fts[0]; | ||
} | ||
} | ||
switch (model.type) { | ||
case 'directory': | ||
if (ft !== null && ft.contentType === 'directory') { | ||
return ft; | ||
} | ||
return (find(this._fileTypes, ft => ft.contentType === 'directory') || | ||
DocumentRegistry.getDefaultDirectoryFileType(this.translator)); | ||
case 'notebook': | ||
if (ft !== null && ft.contentType === 'notebook') { | ||
return ft; | ||
} | ||
return (find(this._fileTypes, ft => ft.contentType === 'notebook') || | ||
@@ -592,8 +606,4 @@ DocumentRegistry.getDefaultNotebookFileType(this.translator)); | ||
// Find the best matching extension. | ||
if (model.name || model.path) { | ||
const name = model.name || PathExt.basename(model.path); | ||
const fts = this.getFileTypesForPath(name); | ||
if (fts.length > 0) { | ||
return fts[0]; | ||
} | ||
if (ft !== null) { | ||
return ft; | ||
} | ||
@@ -600,0 +610,0 @@ return (this.getFileType('text') || |
{ | ||
"name": "@jupyterlab/docregistry", | ||
"version": "4.2.0-alpha.0", | ||
"version": "4.2.0-alpha.1", | ||
"description": "JupyterLab - Document Registry", | ||
@@ -45,12 +45,12 @@ "homepage": "https://github.com/jupyterlab/jupyterlab", | ||
"dependencies": { | ||
"@jupyter/ydoc": "^1.1.1", | ||
"@jupyterlab/apputils": "^4.3.0-alpha.0", | ||
"@jupyterlab/codeeditor": "^4.2.0-alpha.0", | ||
"@jupyterlab/coreutils": "^6.2.0-alpha.0", | ||
"@jupyterlab/observables": "^5.2.0-alpha.0", | ||
"@jupyterlab/rendermime": "^4.2.0-alpha.0", | ||
"@jupyterlab/rendermime-interfaces": "^3.10.0-alpha.0", | ||
"@jupyterlab/services": "^7.2.0-alpha.0", | ||
"@jupyterlab/translation": "^4.2.0-alpha.0", | ||
"@jupyterlab/ui-components": "^4.2.0-alpha.0", | ||
"@jupyter/ydoc": "^2.0.1", | ||
"@jupyterlab/apputils": "^4.3.0-alpha.1", | ||
"@jupyterlab/codeeditor": "^4.2.0-alpha.1", | ||
"@jupyterlab/coreutils": "^6.2.0-alpha.1", | ||
"@jupyterlab/observables": "^5.2.0-alpha.1", | ||
"@jupyterlab/rendermime": "^4.2.0-alpha.1", | ||
"@jupyterlab/rendermime-interfaces": "^3.10.0-alpha.1", | ||
"@jupyterlab/services": "^7.2.0-alpha.1", | ||
"@jupyterlab/translation": "^4.2.0-alpha.1", | ||
"@jupyterlab/ui-components": "^4.2.0-alpha.1", | ||
"@lumino/algorithm": "^2.0.1", | ||
@@ -66,3 +66,3 @@ "@lumino/coreutils": "^2.1.2", | ||
"devDependencies": { | ||
"@jupyterlab/testing": "^4.2.0-alpha.0", | ||
"@jupyterlab/testing": "^4.2.0-alpha.1", | ||
"@types/jest": "^29.2.0", | ||
@@ -69,0 +69,0 @@ "jest": "^29.2.0", |
@@ -667,4 +667,15 @@ // Copyright (c) Jupyter Development Team. | ||
): DocumentRegistry.IFileType { | ||
let ft: DocumentRegistry.IFileType | null = null; | ||
if (model.name || model.path) { | ||
const name = model.name || PathExt.basename(model.path!); | ||
const fts = this.getFileTypesForPath(name); | ||
if (fts.length > 0) { | ||
ft = fts[0]; | ||
} | ||
} | ||
switch (model.type) { | ||
case 'directory': | ||
if (ft !== null && ft.contentType === 'directory') { | ||
return ft; | ||
} | ||
return ( | ||
@@ -675,2 +686,5 @@ find(this._fileTypes, ft => ft.contentType === 'directory') || | ||
case 'notebook': | ||
if (ft !== null && ft.contentType === 'notebook') { | ||
return ft; | ||
} | ||
return ( | ||
@@ -682,8 +696,4 @@ find(this._fileTypes, ft => ft.contentType === 'notebook') || | ||
// Find the best matching extension. | ||
if (model.name || model.path) { | ||
const name = model.name || PathExt.basename(model.path!); | ||
const fts = this.getFileTypesForPath(name); | ||
if (fts.length > 0) { | ||
return fts[0]; | ||
} | ||
if (ft !== null) { | ||
return ft; | ||
} | ||
@@ -690,0 +700,0 @@ return ( |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
325483
8097
+ Added@jupyter/ydoc@2.1.3(transitive)
- Removed@jupyter/ydoc@1.1.1(transitive)
Updated@jupyter/ydoc@^2.0.1