* Synchronously retrieves the `fs.Stats` * for the `path`. * @param {string | Buffer | URL} path * @param {{ * bigint?: boolean; * throwIfNoEntry?: boolean; * }} [options] * @returns {Stats}
(path, options = { __proto__: null, bigint: false, throwIfNoEntry: true })
| 2076 | * @returns {Stats} |
| 2077 | */ |
| 2078 | function statSync(path, options = { __proto__: null, bigint: false, throwIfNoEntry: true }) { |
| 2079 | const h = vfsState.handlers; |
| 2080 | if (h !== null) { |
| 2081 | const result = h.statSync(path, options); |
| 2082 | if (result !== undefined) return result; |
| 2083 | } |
| 2084 | const stats = binding.stat( |
| 2085 | getValidatedPath(path), |
| 2086 | options.bigint, |
| 2087 | undefined, |
| 2088 | options.throwIfNoEntry, |
| 2089 | ); |
| 2090 | if (stats === undefined) { |
| 2091 | return undefined; |
| 2092 | } |
| 2093 | return getStatsFromBinding(stats); |
| 2094 | } |
| 2095 | |
| 2096 | function statfsSync(path, options = { __proto__: null, bigint: false }) { |
| 2097 | const h = vfsState.handlers; |
no test coverage detected
searching dependent graphs…