@lvce-editor/file-search-worker 1.8.0 → 1.10.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.
@@ -75,6 +75,17 @@ const mkdir = uri => {
75
75
  content: ''
76
76
  };
77
77
  };
78
+ const remove$1 = uri => {
79
+ const toDelete = [];
80
+ for (const key of Object.keys(state$4.files)) {
81
+ if (key.startsWith(uri)) {
82
+ toDelete.push(key);
83
+ }
84
+ }
85
+ for (const key of toDelete) {
86
+ delete state$4.files[key];
87
+ }
88
+ };
78
89
  const readDirWithFileTypes = uri => {
79
90
  if (!uri.endsWith(Slash)) {
80
91
  uri += Slash;
@@ -1267,18 +1278,19 @@ const searchFile = async (path, value, prepare, assetDir) => {
1267
1278
  };
1268
1279
 
1269
1280
  const commandMap = {
1270
- 'SearchFile.searchFile': searchFile,
1271
- 'SearchFile.searchFileWithRipGrep': searchFile$1,
1272
- 'SearchFile.searchFileWithHtml': searchFile$2,
1273
- 'SearchFile.searchFileWithFetch': searchFile$3,
1274
- 'FileSystemMemory.readFile': readFile,
1275
- 'FileSystemMemory.writeFile': writeFile,
1281
+ 'FileSystemMemory.chmod': chmod,
1282
+ 'FileSystemMemory.getBlob': getBlob,
1283
+ 'FileSystemMemory.getBlobUrl': getBlobUrl,
1284
+ 'FileSystemMemory.getFiles': getFiles,
1276
1285
  'FileSystemMemory.mkdir': mkdir,
1277
1286
  'FileSystemMemory.readDirWithFileTypes': readDirWithFileTypes,
1278
- 'FileSystemMemory.getBlobUrl': getBlobUrl,
1279
- 'FileSystemMemory.getBlob': getBlob,
1280
- 'FileSystemMemory.chmod': chmod,
1281
- 'FileSystemMemory.getFiles': getFiles
1287
+ 'FileSystemMemory.readFile': readFile,
1288
+ 'FileSystemMemory.remove': remove$1,
1289
+ 'FileSystemMemory.writeFile': writeFile,
1290
+ 'SearchFile.searchFile': searchFile,
1291
+ 'SearchFile.searchFileWithFetch': searchFile$3,
1292
+ 'SearchFile.searchFileWithHtml': searchFile$2,
1293
+ 'SearchFile.searchFileWithRipGrep': searchFile$1
1282
1294
  };
1283
1295
 
1284
1296
  const requiresSocket = () => {
package/package.json CHANGED
@@ -1,14 +1,10 @@
1
1
  {
2
2
  "name": "@lvce-editor/file-search-worker",
3
- "version": "1.8.0",
3
+ "version": "1.10.0",
4
4
  "description": "",
5
5
  "main": "dist/fileSearchWorkerMain.js",
6
6
  "type": "module",
7
7
  "keywords": [],
8
8
  "author": "",
9
- "license": "MIT",
10
- "dependencies": {
11
- "@lvce-editor/fuzzy-search": "^1.0.0",
12
- "idb": "^8.0.0"
13
- }
9
+ "license": "MIT"
14
10
  }