(path, options = { __proto__: null, bigint: false, throwIfNoEntry: true })
| 1801 | } |
| 1802 | |
| 1803 | async function stat(path, options = { __proto__: null, bigint: false, throwIfNoEntry: true }) { |
| 1804 | const h = vfsState.handlers; |
| 1805 | if (h !== null) { |
| 1806 | const promise = h.stat(path, options); |
| 1807 | if (promise !== undefined) return await promise; |
| 1808 | } |
| 1809 | const result = await PromisePrototypeThen( |
| 1810 | binding.stat(getValidatedPath(path), options.bigint, kUsePromises, options.throwIfNoEntry), |
| 1811 | undefined, |
| 1812 | handleErrorFromBinding, |
| 1813 | ); |
| 1814 | |
| 1815 | // Binding will resolve undefined if UV_ENOENT or UV_ENOTDIR and throwIfNoEntry is false |
| 1816 | if (!options.throwIfNoEntry && result === undefined) return undefined; |
| 1817 | |
| 1818 | return getStatsFromBinding(result); |
| 1819 | } |
| 1820 | |
| 1821 | async function statfs(path, options = { __proto__: null, bigint: false }) { |
| 1822 | const h = vfsState.handlers; |
no test coverage detected
searching dependent graphs…