MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / unmountFileTrack

Function unmountFileTrack

src/pkg/utils/file-tracker.ts:75–90  ·  view source on GitHub ↗
(fileHandle: FileSystemFileHandle)

Source from the content-addressed store, hash-verified

73};
74
75export const unmountFileTrack = async (fileHandle: FileSystemFileHandle) => {
76 try {
77 for (const entry of handleRecords) {
78 const [fileHandleEntry, _ftInfo, fileObserver] = entry;
79 if (await fileHandle.isSameEntry(fileHandleEntry)) {
80 handleRecords.delete(entry);
81 fileObserver.disconnect();
82 return true;
83 }
84 }
85 } catch (e) {
86 // 捕捉非预期错误
87 console.warn(e);
88 }
89 return false;
90};

Callers 3

initAsyncFunction · 0.90
useInstallDataFunction · 0.90
callbackFunction · 0.85

Calls 3

warnMethod · 0.80
deleteMethod · 0.65
disconnectMethod · 0.65

Tested by

no test coverage detected