* Synchronously retrieves the `fs.Stats` for * the symbolic link referred to by the `path`. * @param {string | Buffer | URL} path * @param {{ * bigint?: boolean; * throwIfNoEntry?: boolean; * }} [options] * @returns {Stats | undefined}
(path, options = { __proto__: null, bigint: false, throwIfNoEntry: true })
| 2042 | * @returns {Stats | undefined} |
| 2043 | */ |
| 2044 | function lstatSync(path, options = { __proto__: null, bigint: false, throwIfNoEntry: true }) { |
| 2045 | const h = vfsState.handlers; |
| 2046 | if (h !== null) { |
| 2047 | const result = h.lstatSync(path, options); |
| 2048 | if (result !== undefined) return result; |
| 2049 | } |
| 2050 | path = getValidatedPath(path); |
| 2051 | if (permission.isEnabled() && !permission.has('fs.read', path)) { |
| 2052 | const resource = BufferIsBuffer(path) ? BufferToString(path) : path; |
| 2053 | throw new ERR_ACCESS_DENIED('Access to this API has been restricted', 'FileSystemRead', resource); |
| 2054 | } |
| 2055 | const stats = binding.lstat( |
| 2056 | path, |
| 2057 | options.bigint, |
| 2058 | undefined, |
| 2059 | options.throwIfNoEntry, |
| 2060 | ); |
| 2061 | |
| 2062 | if (stats === undefined) { |
| 2063 | return; |
| 2064 | } |
| 2065 | return getStatsFromBinding(stats); |
| 2066 | } |
| 2067 | |
| 2068 | /** |
| 2069 | * Synchronously retrieves the `fs.Stats` |
no test coverage detected
searching dependent graphs…