@lvce-editor/extension-host-worker 5.22.0 → 5.23.0
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.
|
@@ -1095,6 +1095,9 @@ const readFileExternal = async path => {
|
|
|
1095
1095
|
const content = await invoke$2('FileSystem.readFile', path);
|
|
1096
1096
|
return content;
|
|
1097
1097
|
};
|
|
1098
|
+
const existsExternal = async uri => {
|
|
1099
|
+
return await invoke$2('FileSystem.exists', uri);
|
|
1100
|
+
};
|
|
1098
1101
|
const readDirWithFileTypesExternal = async path => {
|
|
1099
1102
|
// TODO when file is local,
|
|
1100
1103
|
// don't ask renderer worker
|
|
@@ -3214,6 +3217,7 @@ const api = {
|
|
|
3214
3217
|
registerFileSystemProvider: registerFileSystemProvider,
|
|
3215
3218
|
readFile: readFileExternal,
|
|
3216
3219
|
readDirWithFileTypes: readDirWithFileTypesExternal,
|
|
3220
|
+
exists: existsExternal,
|
|
3217
3221
|
// Formatting
|
|
3218
3222
|
registerFormattingProvider: registerFormattingProvider,
|
|
3219
3223
|
executeFormattingProvider: executeFormattingProvider,
|
|
@@ -5078,6 +5082,13 @@ const readFile = uri => {
|
|
|
5078
5082
|
}
|
|
5079
5083
|
return dirent.content;
|
|
5080
5084
|
};
|
|
5085
|
+
const exists = uri => {
|
|
5086
|
+
const dirent = getDirent(uri);
|
|
5087
|
+
if (!dirent) {
|
|
5088
|
+
return false;
|
|
5089
|
+
}
|
|
5090
|
+
return true;
|
|
5091
|
+
};
|
|
5081
5092
|
const ensureParentDir = uri => {
|
|
5082
5093
|
const startIndex = 0;
|
|
5083
5094
|
let endIndex = uri.indexOf(Slash);
|
|
@@ -6032,6 +6043,7 @@ const commandMap = {
|
|
|
6032
6043
|
'FileSystemFetch.remove': remove$2,
|
|
6033
6044
|
'FileSystemFetch.writeFile': writeFile$1,
|
|
6034
6045
|
'FileSystemMemory.chmod': chmod,
|
|
6046
|
+
'FileSystemMemory.exists': exists,
|
|
6035
6047
|
'FileSystemMemory.copy': copy,
|
|
6036
6048
|
'FileSystemMemory.getBlob': getBlob,
|
|
6037
6049
|
'FileSystemMemory.getBlobUrl': getBlobUrl,
|