@lvce-editor/file-system-process 5.8.0 → 5.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.
- package/dist/index.js +1 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1868,16 +1868,12 @@ const getFolderSize = async uri => {
|
|
|
1868
1868
|
return total;
|
|
1869
1869
|
};
|
|
1870
1870
|
|
|
1871
|
-
const fileWacherEvents = Object.create(null);
|
|
1872
1871
|
const setupWatcher = async (watcherId, uri, onChange) => {
|
|
1873
1872
|
try {
|
|
1874
1873
|
const path = fileURLToPath(uri);
|
|
1875
1874
|
// TODO
|
|
1876
1875
|
const watcher = fs.watch(path, {});
|
|
1877
|
-
const
|
|
1878
|
-
fileWacherEvents[watcherId] = watcherEvents;
|
|
1879
|
-
for await (const event of watcher) {
|
|
1880
|
-
watcherEvents.push(event);
|
|
1876
|
+
for await (const _event of watcher) {
|
|
1881
1877
|
onChange();
|
|
1882
1878
|
}
|
|
1883
1879
|
} catch (error) {
|
|
@@ -1891,7 +1887,6 @@ const setupWatcher = async (watcherId, uri, onChange) => {
|
|
|
1891
1887
|
// TODO when socket closes, dispose file watcher for this socket
|
|
1892
1888
|
const watchFile = async (socket, watcherId, uri) => {
|
|
1893
1889
|
assertUri(uri);
|
|
1894
|
-
fileWacherEvents[watcherId] = [];
|
|
1895
1890
|
// TODO await promise?
|
|
1896
1891
|
const onChange = () => {
|
|
1897
1892
|
// TODO handle error
|