MCPcopy
hub / github.com/remotely-save/remotely-save / statFix

Function statFix

src/misc.ts:422–440  ·  view source on GitHub ↗
(vault: Vault, path: string)

Source from the content-addressed store, hash-verified

420 * @param path
421 */
422export const statFix = async (vault: Vault, path: string) => {
423 const s = await vault.adapter.stat(path);
424 if (s === undefined || s === null) {
425 throw Error(`${path} doesn't exist cannot run stat`);
426 }
427 if (s.ctime === undefined || s.ctime === null || Number.isNaN(s.ctime)) {
428 s.ctime = undefined as any; // force assignment
429 }
430 if (s.mtime === undefined || s.mtime === null || Number.isNaN(s.mtime)) {
431 s.mtime = undefined as any; // force assignment
432 }
433 if (
434 (s.size === undefined || s.size === null || Number.isNaN(s.size)) &&
435 s.type === "folder"
436 ) {
437 s.size = 0;
438 }
439 return s;
440};
441
442export const isSpecialFolderNameToSkip = (
443 x: string,

Callers 2

listFilesInObsFolderFunction · 0.90
statMethod · 0.90

Calls 1

statMethod · 0.45

Tested by

no test coverage detected