@lvce-editor/file-system-worker 5.19.0 → 5.19.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.
|
@@ -1995,6 +1995,12 @@ const isMemory = uri => {
|
|
|
1995
1995
|
return uri.startsWith(Memory);
|
|
1996
1996
|
};
|
|
1997
1997
|
|
|
1998
|
+
// Disk paths and built-in HTTP reads stay in this worker. Other URI schemes
|
|
1999
|
+
// need the renderer's filesystem dispatcher, which activates extension providers.
|
|
2000
|
+
const isProviderUri = uri => {
|
|
2001
|
+
return /^[a-z][a-z\d+.-]*:\/\//i.test(uri) && !uri.startsWith('file:') && !isHttp(uri);
|
|
2002
|
+
};
|
|
2003
|
+
|
|
1998
2004
|
const remove = async dirent => {
|
|
1999
2005
|
if (isMemory(dirent)) {
|
|
2000
2006
|
return remove$1(dirent);
|
|
@@ -2008,7 +2014,7 @@ const readFile = async uri => {
|
|
|
2008
2014
|
if (isHttp(uri)) {
|
|
2009
2015
|
return readFile$3(uri);
|
|
2010
2016
|
}
|
|
2011
|
-
if (isMemory(uri)) {
|
|
2017
|
+
if (isMemory(uri) || isProviderUri(uri)) {
|
|
2012
2018
|
return invoke$2('FileSystem.readFile', uri);
|
|
2013
2019
|
}
|
|
2014
2020
|
return readFile$2(uri);
|
|
@@ -2026,7 +2032,7 @@ const readDirWithFileTypes = async uri => {
|
|
|
2026
2032
|
if (isFetch(uri) || isHtml(uri)) {
|
|
2027
2033
|
return invoke$2('FileSystem.readDirWithFileTypes', uri);
|
|
2028
2034
|
}
|
|
2029
|
-
if (isMemory(uri)) {
|
|
2035
|
+
if (isMemory(uri) || isProviderUri(uri)) {
|
|
2030
2036
|
return invoke$2('FileSystem.readDirWithFileTypes', uri);
|
|
2031
2037
|
}
|
|
2032
2038
|
return readDirWithFileTypes$2(uri);
|