@lvce-editor/extension-host-worker 5.32.0 → 5.34.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.
@@ -2195,7 +2195,10 @@ const mkdirExternal = async uri => {
2195
2195
  return await invoke$1('FileSystem.mkdir', uri);
2196
2196
  };
2197
2197
  const writeFileExternal = async (uri, content) => {
2198
- return await invoke$1('FileSystem.writeFIle', uri, content);
2198
+ return await invoke$1('FileSystem.writeFile', uri, content);
2199
+ };
2200
+ const statExternal = async uri => {
2201
+ return await invoke$1('FileSystem.stat', uri);
2199
2202
  };
2200
2203
  const readDirWithFileTypesExternal = async path => {
2201
2204
  // TODO when file is local,
@@ -3378,6 +3381,7 @@ const api = {
3378
3381
  exists: existsExternal,
3379
3382
  mkdir: mkdirExternal,
3380
3383
  writeFile: writeFileExternal,
3384
+ stat: statExternal,
3381
3385
  // Formatting
3382
3386
  registerFormattingProvider: registerFormattingProvider,
3383
3387
  executeFormattingProvider: executeFormattingProvider,
@@ -5173,6 +5177,31 @@ const exists = uri => {
5173
5177
  }
5174
5178
  return true;
5175
5179
  };
5180
+ const stat = uri => {
5181
+ const dirent = getDirent(uri);
5182
+ if (!dirent) {
5183
+ return {
5184
+ exists: false,
5185
+ size: 0
5186
+ };
5187
+ }
5188
+ if (dirent.type === File$1) {
5189
+ return {
5190
+ exists: true,
5191
+ type: File$1
5192
+ };
5193
+ }
5194
+ if (dirent.type === Directory$1) {
5195
+ return {
5196
+ exists: true,
5197
+ type: Directory$1
5198
+ };
5199
+ }
5200
+ return {
5201
+ exists: true,
5202
+ type: dirent.type
5203
+ };
5204
+ };
5176
5205
  const ensureParentDir = uri => {
5177
5206
  const startIndex = 0;
5178
5207
  let endIndex = uri.indexOf(Slash);
@@ -6147,6 +6176,7 @@ const commandMap = {
6147
6176
  'FileSystemMemory.chmod': chmod,
6148
6177
  'FileSystemMemory.copy': copy,
6149
6178
  'FileSystemMemory.exists': exists,
6179
+ 'FileSystemMemory.stat': stat,
6150
6180
  'FileSystemMemory.getBlob': getBlob,
6151
6181
  'FileSystemMemory.getBlobUrl': getBlobUrl,
6152
6182
  'FileSystemMemory.getFiles': getFiles,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-host-worker",
3
- "version": "5.32.0",
3
+ "version": "5.34.0",
4
4
  "description": "Webworker for the extension host functionality in Lvce Editor.",
5
5
  "keywords": [
6
6
  "web-worker"