(vault: Vault, path: string)
| 420 | * @param path |
| 421 | */ |
| 422 | export 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 | |
| 442 | export const isSpecialFolderNameToSkip = ( |
| 443 | x: string, |
no test coverage detected