@lvce-editor/file-system-process 1.0.0 → 1.2.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.
- package/dist/index.js +24 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from 'node:fs/promises';
|
|
2
2
|
import * as os from 'node:os';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { string } from '@lvce-editor/assert';
|
|
4
|
+
import { string, object } from '@lvce-editor/assert';
|
|
5
5
|
import { VError } from '@lvce-editor/verror';
|
|
6
6
|
import { join } from 'node:path';
|
|
7
7
|
import { existsSync } from 'node:fs';
|
|
@@ -416,19 +416,30 @@ const getFolderSize = async uri => {
|
|
|
416
416
|
return total;
|
|
417
417
|
};
|
|
418
418
|
|
|
419
|
+
const handleWebSocket = async (handle, request) => {
|
|
420
|
+
object(handle);
|
|
421
|
+
object(request);
|
|
422
|
+
await listen$1({
|
|
423
|
+
method: WebSocket,
|
|
424
|
+
request,
|
|
425
|
+
handle
|
|
426
|
+
});
|
|
427
|
+
};
|
|
428
|
+
|
|
419
429
|
const commandMap = {
|
|
420
|
-
chmod: chmod,
|
|
421
|
-
copy: copy,
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
'FileSystem.chmod': chmod,
|
|
431
|
+
'FileSystem.copy': copy,
|
|
432
|
+
'FileSystem.getFolderSize': getFolderSize,
|
|
433
|
+
'FileSystem.getPathSeparator': getPathSeparator,
|
|
434
|
+
'FileSystem.mkdir': mkdir,
|
|
435
|
+
'FileSystem.readDirWithFileTypes': readDirWithFileTypes,
|
|
436
|
+
'FileSystem.readFile': readFile,
|
|
437
|
+
'FileSystem.readJson': readJson,
|
|
438
|
+
'FileSystem.remove': remove,
|
|
439
|
+
'FileSystem.rename': rename,
|
|
440
|
+
'FileSystem.stat': stat,
|
|
441
|
+
'FileSystem.writeFile': writeFile,
|
|
442
|
+
'HandleWebSocket.handleWebSocket': handleWebSocket
|
|
432
443
|
};
|
|
433
444
|
|
|
434
445
|
const listen = async argv => {
|